diff --git a/routers/user/auth.go b/routers/user/auth.go index 40687fca6..f4ce11376 100644 --- a/routers/user/auth.go +++ b/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) { diff --git a/templates/base/head.tmpl b/templates/base/head.tmpl index 68ea47894..77122e1bd 100644 --- a/templates/base/head.tmpl +++ b/templates/base/head.tmpl @@ -122,7 +122,7 @@ {{end}}
- + {{.i18n.Tr "sign_out"}}