aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/web.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2024-10-02 12:37:16 +0800
committerGitHub <noreply@github.com>2024-10-02 04:37:16 +0000
commita989404e23f736e7ce1c71e7105506e3bc6cdd76 (patch)
tree10e3c797b382de65fde50a076a61f020d4fb5389 /routers/web/web.go
parent3a4a1bffbebd8a6f024a7fc4849cebbd7f0274d4 (diff)
downloadgitea-a989404e23f736e7ce1c71e7105506e3bc6cdd76.tar.gz
gitea-a989404e23f736e7ce1c71e7105506e3bc6cdd76.zip
Fix javascript error when an anonymous user visiting migration page (#32144)
This PR fixes javascript errors when an anonymous user visits the migration page. It also makes task view checking more restrictive. The router moved from `/user/task/{id}/status` to `/username/reponame/-/migrate/status` because it's a migrate status. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'routers/web/web.go')
-rw-r--r--routers/web/web.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/routers/web/web.go b/routers/web/web.go
index af46c36fe7..69258bca18 100644
--- a/routers/web/web.go
+++ b/routers/web/web.go
@@ -669,7 +669,6 @@ func registerRoutes(m *web.Router) {
m.Get("/forgot_password", auth.ForgotPasswd)
m.Post("/forgot_password", auth.ForgotPasswdPost)
m.Post("/logout", auth.SignOut)
- m.Get("/task/{task}", reqSignIn, user.TaskStatus)
m.Get("/stopwatches", reqSignIn, user.GetStopwatches)
m.Get("/search", ignExploreSignIn, user.Search)
m.Group("/oauth2", func() {
@@ -1042,6 +1041,13 @@ func registerRoutes(m *web.Router) {
}, ignSignIn, context.UserAssignmentWeb(), context.OrgAssignment())
// end "/{username}/-": packages, projects, code
+ m.Group("/{username}/{reponame}/-", func() {
+ m.Group("/migrate", func() {
+ m.Get("/status", repo.MigrateStatus)
+ })
+ }, ignSignIn, context.RepoAssignment, reqRepoCodeReader)
+ // end "/{username}/{reponame}/-": migrate
+
m.Group("/{username}/{reponame}/settings", func() {
m.Group("", func() {
m.Combo("").Get(repo_setting.Settings).