mirror of
https://github.com/coder/coder.git
synced 2026-10-16 14:48:56 +08:00
Make OAuth2 refresh token redemption single-use under concurrency using DELETE ... RETURNING, ensuring exactly one request succeeds and losing requests return invalid_grant. Remove the redundant API-key lookup to prevent 500s on missing keys, explicitly use READ COMMITTED for both grant transactions, and replace whitespace-only stored-scope echoes with a fixed error message. Add regression coverage for concurrent redemption, revoked or missing keys, and invalid stored scopes.