aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcolorfulberry <senluowanxiangt@gmail.com>2020-04-26 06:11:32 +0800
committerGitHub <noreply@github.com>2020-04-25 23:11:32 +0100
commitf1f56da4d1339345ffea68d675e972648bd60a59 (patch)
tree5e0fba8b7f22bf06211561af4d0b982f039c2709
parente008b68c9c312681d4098f6f3b8f208479f4f43a (diff)
downloadgitea-f1f56da4d1339345ffea68d675e972648bd60a59.tar.gz
gitea-f1f56da4d1339345ffea68d675e972648bd60a59.zip
On logout redirect to start page and clear redirect cookie (#11202)
when one user logout should clear redirect to value, otherwise switch the account will occur error. Co-authored-by: Lauris BH <lauris@nix.lv>
-rw-r--r--routers/user/auth.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/routers/user/auth.go b/routers/user/auth.go
index 5ad095b857..9d242bcfc2 100644
--- a/routers/user/auth.go
+++ b/routers/user/auth.go
@@ -1001,6 +1001,7 @@ func handleSignOut(ctx *context.Context) {
ctx.SetCookie(setting.CookieRememberName, "", -1, setting.AppSubURL, setting.SessionConfig.Domain, setting.SessionConfig.Secure, true)
ctx.SetCookie(setting.CSRFCookieName, "", -1, setting.AppSubURL, setting.SessionConfig.Domain, setting.SessionConfig.Secure, true)
ctx.SetCookie("lang", "", -1, setting.AppSubURL, setting.SessionConfig.Domain, setting.SessionConfig.Secure, true) // Setting the lang cookie will trigger the middleware to reset the language ot previous state.
+ ctx.SetCookie("redirect_to", "", -1, setting.AppSubURL) // logout default should set redirect to to default
}
// SignOut sign out from login status