mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix: mark users seen when activating on login (#21305)
fixes #21303 Update user last_seen_at when we mark them active on login. This prevents a narrow race where they can be re-marked dormant and fail to log in.
This commit is contained in:
+4
-3
@@ -885,9 +885,10 @@ func (api *API) putUserStatus(status database.UserStatus) func(rw http.ResponseW
|
||||
}
|
||||
|
||||
targetUser, err := api.Database.UpdateUserStatus(ctx, database.UpdateUserStatusParams{
|
||||
ID: user.ID,
|
||||
Status: status,
|
||||
UpdatedAt: dbtime.Now(),
|
||||
ID: user.ID,
|
||||
Status: status,
|
||||
UpdatedAt: dbtime.Now(),
|
||||
UserIsSeen: false,
|
||||
})
|
||||
if err != nil {
|
||||
httpapi.Write(ctx, rw, http.StatusInternalServerError, codersdk.Response{
|
||||
|
||||
Reference in New Issue
Block a user