Skip to content

Commit

Permalink
On logout redirect to start page and clear redirect cookie (#11202)
Browse files Browse the repository at this point in the history
when one user logout should clear redirect to value, otherwise switch the account will occur error.

Co-authored-by: Lauris BH <[email protected]>
  • Loading branch information
colorfulberry and lafriks committed Apr 25, 2020
1 parent e008b68 commit f1f56da
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions routers/user/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f1f56da

Please sign in to comment.