Browse Source

Do not change page on logout

pull/3449/head
Sandro Santilli 8 years ago
parent
commit
bd15a7b2de
  1. 7
      routers/user/auth.go
  2. 2
      templates/base/head.tmpl

7
routers/user/auth.go

@ -138,7 +138,12 @@ func SignOut(ctx *context.Context) {
ctx.SetCookie(setting.CookieUserName, "", -1, setting.AppSubUrl)
ctx.SetCookie(setting.CookieRememberName, "", -1, setting.AppSubUrl)
ctx.SetCookie(setting.CSRFCookieName, "", -1, setting.AppSubUrl)
ctx.Redirect(setting.AppSubUrl + "/")
if redirectTo, _ := url.QueryUnescape(ctx.Query("redirect_to")); len(redirectTo) > 0 {
ctx.Redirect(redirectTo)
} else {
ctx.Redirect(setting.AppSubUrl + "/")
}
}
func SignUp(ctx *context.Context) {

2
templates/base/head.tmpl

@ -122,7 +122,7 @@
{{end}}
<div class="divider"></div>
<a class="item" href="{{AppSubUrl}}/user/logout">
<a class="item" href="{{AppSubUrl}}/user/logout?redirect_to={{.Link}}">
<i class="octicon octicon-sign-out"></i>
{{.i18n.Tr "sign_out"}}<!-- Sign Out -->
</a>

Loading…
Cancel
Save