1
0
Fork 0
forked from forgejo/forgejo

Refactor and simplify redirect to url (#3674)

This commit is contained in:
Lauris BH 2018-03-15 23:13:34 +02:00 committed by Kim "BKC" Carlbäcker
parent a2a49c93c7
commit 7b2b900e13
5 changed files with 29 additions and 24 deletions

View file

@ -50,12 +50,8 @@ func SignInOpenID(ctx *context.Context) {
}
if isSucceed {
if len(redirectTo) > 0 {
ctx.SetCookie("redirect_to", "", -1, setting.AppSubURL)
ctx.Redirect(redirectTo)
} else {
ctx.Redirect(setting.AppSubURL + "/")
}
ctx.SetCookie("redirect_to", "", -1, setting.AppSubURL)
ctx.RedirectToFirst(redirectTo)
return
}