Skip to content

Commit ee3a21a

Browse files
author
Gusted
authored
Fix middleware function's placements for /user/... (#19377) (#19378)
- Backport #19377 - Add reqSignIn to `/user/task/{task}` as it specific to a logged in user currently not-logged in user could cause a NPE. - Remove `/user/active` reqSignIn middleware, because when you want to active a account you're not "signed in" so it doesn't make sense to add that middleware.
1 parent 61c7732 commit ee3a21a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

routers/web/web.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -374,16 +374,16 @@ func RegisterRoutes(m *web.Route) {
374374

375375
m.Group("/user", func() {
376376
// r.Get("/feeds", binding.Bind(auth.FeedsForm{}), user.Feeds)
377-
m.Get("/activate", auth.Activate, reqSignIn)
378-
m.Post("/activate", auth.ActivatePost, reqSignIn)
377+
m.Get("/activate", auth.Activate)
378+
m.Post("/activate", auth.ActivatePost)
379379
m.Any("/activate_email", auth.ActivateEmail)
380380
m.Get("/avatar/{username}/{size}", user.AvatarByUserName)
381381
m.Get("/recover_account", auth.ResetPasswd)
382382
m.Post("/recover_account", auth.ResetPasswdPost)
383383
m.Get("/forgot_password", auth.ForgotPasswd)
384384
m.Post("/forgot_password", auth.ForgotPasswdPost)
385385
m.Post("/logout", auth.SignOut)
386-
m.Get("/task/{task}", user.TaskStatus)
386+
m.Get("/task/{task}", reqSignIn, user.TaskStatus)
387387
})
388388
// ***** END: User *****
389389

0 commit comments

Comments
 (0)