@@ -93,12 +93,8 @@ func checkAutoLogin(ctx *context.Context) bool {
93
93
}
94
94
95
95
if isSucceed {
96
- if len (redirectTo ) > 0 {
97
- ctx .SetCookie ("redirect_to" , "" , - 1 , setting .AppSubURL )
98
- ctx .Redirect (redirectTo )
99
- } else {
100
- ctx .Redirect (setting .AppSubURL + string (setting .LandingPageURL ))
101
- }
96
+ ctx .SetCookie ("redirect_to" , "" , - 1 , setting .AppSubURL )
97
+ ctx .RedirectToFirst (redirectTo , setting .AppSubURL + string (setting .LandingPageURL ))
102
98
return true
103
99
}
104
100
@@ -350,7 +346,7 @@ func handleSignInFull(ctx *context.Context, u *models.User, remember bool, obeyR
350
346
if redirectTo , _ := url .QueryUnescape (ctx .GetCookie ("redirect_to" )); len (redirectTo ) > 0 {
351
347
ctx .SetCookie ("redirect_to" , "" , - 1 , setting .AppSubURL )
352
348
if obeyRedirect {
353
- ctx .Redirect (redirectTo )
349
+ ctx .RedirectToFirst (redirectTo )
354
350
}
355
351
return
356
352
}
@@ -439,7 +435,7 @@ func handleOAuth2SignIn(u *models.User, gothUser goth.User, ctx *context.Context
439
435
440
436
if redirectTo , _ := url .QueryUnescape (ctx .GetCookie ("redirect_to" )); len (redirectTo ) > 0 {
441
437
ctx .SetCookie ("redirect_to" , "" , - 1 , setting .AppSubURL )
442
- ctx .Redirect (redirectTo )
438
+ ctx .RedirectToFirst (redirectTo )
443
439
return
444
440
}
445
441
0 commit comments