#2748 fix redirect loop with auto-signin
This commit is contained in:
parent
dfbda48afc
commit
f6759a731a
4 changed files with 5 additions and 4 deletions
|
@ -113,7 +113,8 @@ func Toggle(options *ToggleOptions) macaron.Handler {
|
|||
if !options.SignOutRequire && !ctx.IsSigned && !auth.IsAPIPath(ctx.Req.URL.Path) &&
|
||||
len(ctx.GetCookie(setting.CookieUserName)) > 0 {
|
||||
ctx.SetCookie("redirect_to", url.QueryEscape(setting.AppSubUrl+ctx.Req.RequestURI), 0, setting.AppSubUrl)
|
||||
ctx.Redirect(setting.AppSubUrl + ctx.Req.RequestURI)
|
||||
ctx.Redirect(setting.AppSubUrl + "/user/login")
|
||||
return
|
||||
}
|
||||
|
||||
if options.AdminRequire {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue