mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-11-04 08:29:23 -05:00 
			
		
		
		
	Set last login when activating account (#21731)
Fix #21698. Set the last login time to the current time when activating the user successfully. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
		@@ -783,6 +783,13 @@ func handleAccountActivation(ctx *context.Context, user *user_model.User) {
 | 
				
			|||||||
		return
 | 
							return
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// Register last login
 | 
				
			||||||
 | 
						user.SetLastLogin()
 | 
				
			||||||
 | 
						if err := user_model.UpdateUserCols(ctx, user, "last_login_unix"); err != nil {
 | 
				
			||||||
 | 
							ctx.ServerError("UpdateUserCols", err)
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ctx.Flash.Success(ctx.Tr("auth.account_activated"))
 | 
						ctx.Flash.Success(ctx.Tr("auth.account_activated"))
 | 
				
			||||||
	ctx.Redirect(setting.AppSubURL + "/")
 | 
						ctx.Redirect(setting.AppSubURL + "/")
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user