mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 21:28:11 +09:00 
			
		
		
		
	Support to last login feature
This commit is contained in:
		| @@ -127,6 +127,13 @@ func SignInPost(ctx *context.Context, form auth.SignInForm) { | ||||
| 	// Clear whatever CSRF has right now, force to generate a new one | ||||
| 	ctx.SetCookie(setting.CSRFCookieName, "", -1, setting.AppSubUrl) | ||||
|  | ||||
| 	// Register last login | ||||
| 	u.SetLastLogin() | ||||
| 	if err := models.UpdateUser(u); err != nil { | ||||
| 	    ctx.Handle(500, "UpdateUser", err) | ||||
| 	    return | ||||
| 	} | ||||
|  | ||||
| 	if redirectTo, _ := url.QueryUnescape(ctx.GetCookie("redirect_to")); len(redirectTo) > 0 { | ||||
| 		ctx.SetCookie("redirect_to", "", -1, setting.AppSubUrl) | ||||
| 		ctx.Redirect(redirectTo) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user