mirror of
https://github.com/go-gitea/gitea
synced 2024-12-22 14:44:12 +01:00
#3448 redirect if any after sign in
This commit is contained in:
parent
c30b856d14
commit
f0b5c3b90a
1 changed files with 8 additions and 1 deletions
|
@ -76,8 +76,15 @@ func SignIn(ctx *context.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
redirectTo := ctx.Query("redirect_to")
|
||||
if len(redirectTo) > 0 {
|
||||
ctx.SetCookie("redirect_to", redirectTo, 0, setting.AppSubUrl)
|
||||
} else {
|
||||
redirectTo, _ = url.QueryUnescape(ctx.GetCookie("redirect_to"))
|
||||
}
|
||||
|
||||
if isSucceed {
|
||||
if redirectTo, _ := url.QueryUnescape(ctx.GetCookie("redirect_to")); len(redirectTo) > 0 {
|
||||
if len(redirectTo) > 0 {
|
||||
ctx.SetCookie("redirect_to", "", -1, setting.AppSubUrl)
|
||||
ctx.Redirect(redirectTo)
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue