Browse Source

Do not change page on logout

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

5
routers/user/auth.go

@ -138,8 +138,13 @@ 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)
if redirectTo, _ := url.QueryUnescape(ctx.Query("redirect_to")); len(redirectTo) > 0 {
ctx.Redirect(redirectTo)
} else {
ctx.Redirect(setting.AppSubUrl + "/")
}
}
func SignUp(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("sign_up")

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