|
|
@@ -81,8 +81,13 @@ func Toggle(options *ToggleOptions) macaron.Handler { |
|
|
|
|
|
|
|
// Redirect to dashboard if user tries to visit any non-login page. |
|
|
|
if options.SignOutRequired && ctx.IsSigned && ctx.Req.URL.RequestURI() != "/" { |
|
|
|
log.Info("YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY") |
|
|
|
ctx.Redirect(setting.AppSubURL + "/") |
|
|
|
redirectTo := ctx.Query("redirect_to") |
|
|
|
log.Info("redirect_to=" + redirectTo) |
|
|
|
if len(redirectTo) > 0 { |
|
|
|
ctx.Redirect(redirectTo) |
|
|
|
} else { |
|
|
|
ctx.Redirect(setting.AppSubURL + "/") |
|
|
|
} |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|