Set last login when activating account (#21731) (#21754)

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>
tokarchuk/v1.17
Jason Song 2 years ago committed by GitHub
parent 9414260d67
commit 43bddc1405
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      routers/web/auth/auth.go

@ -775,6 +775,13 @@ func handleAccountActivation(ctx *context.Context, user *user_model.User) {
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.Redirect(setting.AppSubURL + "/")
}

Loading…
Cancel
Save