mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-30 06:38:37 -04:00 
			
		
		
		
	#3448 redirect if any after sign in
This commit is contained in:
		| @@ -76,8 +76,15 @@ func SignIn(ctx *context.Context) { | |||||||
| 		return | 		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 isSucceed { | ||||||
| 		if redirectTo, _ := url.QueryUnescape(ctx.GetCookie("redirect_to")); len(redirectTo) > 0 { | 		if len(redirectTo) > 0 { | ||||||
| 			ctx.SetCookie("redirect_to", "", -1, setting.AppSubUrl) | 			ctx.SetCookie("redirect_to", "", -1, setting.AppSubUrl) | ||||||
| 			ctx.Redirect(redirectTo) | 			ctx.Redirect(redirectTo) | ||||||
| 		} else { | 		} else { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user