Skip to content

Commit

Permalink
Set last login when activating account (go-gitea#21731)
Browse files Browse the repository at this point in the history
Fix go-gitea#21698.

Set the last login time to the current time when activating the user
successfully.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
  • Loading branch information
2 people authored and fsologureng committed Nov 9, 2022
1 parent 7df8d5f commit 71008fd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions routers/web/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,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 + "/")
}
Expand Down

0 comments on commit 71008fd

Please sign in to comment.