mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-10 12:15:43 +01:00
Backport #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:
parent
9414260d67
commit
43bddc1405
1 changed files with 7 additions and 0 deletions
|
@ -775,6 +775,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 + "/")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue