Refactor and simplify redirect to url (#3674) (#3676)

This commit is contained in:
Lauris BH
2018-03-16 19:59:47 +08:00
committed by Lunny Xiao
parent 0c612124f9
commit c0e0fb7d39
5 changed files with 29 additions and 24 deletions
+2 -6
View File
@@ -49,12 +49,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
}