mirror of
https://github.com/coder/coder.git
synced 2026-06-03 04:58:23 +00: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:
@@ -325,7 +325,9 @@ UPDATE
|
||||
users
|
||||
SET
|
||||
status = $2,
|
||||
updated_at = $3
|
||||
updated_at = $3,
|
||||
-- If the user is logging in, set last_seen_at to updated_at.
|
||||
last_seen_at = CASE WHEN @user_is_seen :: boolean THEN $3 :: timestamptz ELSE last_seen_at END
|
||||
WHERE
|
||||
id = $1 RETURNING *;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user