Files
Garrett Delfosse 63a9280a6f fix(externalauth): prevent race condition in token refresh with optimistic locking (#22904) (backport to 2.29) (#24901)
Backport of https://github.com/coder/coder/pull/22904 to `release/2.29`.

Adds an optimistic lock to `UpdateExternalAuthLinkRefreshToken` so that
a concurrent caller that lost a token-refresh race cannot overwrite a
valid token stored by the winner. The SQL `WHERE` clause now includes
`AND oauth_refresh_token = @old_oauth_refresh_token`.

Original PR: #22904
Merge commit: 53e52aef78

Cherry-pick applied cleanly with no conflicts.

> Generated by Coder Agents

Co-authored-by: Kyle Carberry <kyle@coder.com>
2026-05-01 14:37:11 -04:00
..