summaryrefslogtreecommitdiffstats
path: root/modules/context/auth.go
diff options
context:
space:
mode:
authorguillep2k <18600385+guillep2k@users.noreply.github.com>2020-05-27 04:08:14 -0300
committerGitHub <noreply@github.com>2020-05-27 08:08:14 +0100
commit600bb545f3fb016d6833d0be92e1af7153f30454 (patch)
treeff48427f149bf772ddbc304471ec84c28eb1d020 /modules/context/auth.go
parent5331af1854db92f1b29c16ee50b63199d43573e0 (diff)
downloadgitea-600bb545f3fb016d6833d0be92e1af7153f30454.tar.gz
gitea-600bb545f3fb016d6833d0be92e1af7153f30454.zip
When must change password only show Signout (#11600) (#11637)
When "Must Change Password" simplify the navbar header to only show the signout button as all other links will redirect back. This prevents the notifications icon from showing preventing initialization of the event-source and hence preventing redirect_to being set, however in addition do not set the redirect_to cookie if we are looking at the /user/events page. Fix #11554 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: zeripath <art27@cantab.net>
Diffstat (limited to 'modules/context/auth.go')
-rw-r--r--modules/context/auth.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/context/auth.go b/modules/context/auth.go
index 7410db75a5..86922aae59 100644
--- a/modules/context/auth.go
+++ b/modules/context/auth.go
@@ -49,7 +49,9 @@ func Toggle(options *ToggleOptions) macaron.Handler {
if ctx.Req.URL.Path != "/user/settings/change_password" {
ctx.Data["Title"] = ctx.Tr("auth.must_change_password")
ctx.Data["ChangePasscodeLink"] = setting.AppSubURL + "/user/change_password"
- ctx.SetCookie("redirect_to", setting.AppSubURL+ctx.Req.URL.RequestURI(), 0, setting.AppSubURL)
+ if ctx.Req.URL.Path != "/user/events" {
+ ctx.SetCookie("redirect_to", setting.AppSubURL+ctx.Req.URL.RequestURI(), 0, setting.AppSubURL)
+ }
ctx.Redirect(setting.AppSubURL + "/user/settings/change_password")
return
}