During token exchange where an authorization code is exchanged for an access token and a refresh token, the same code can be used more than once. This happens if more requests are issued in parallel.
This PR adds a .select_for_update so only the first attempt goes through.
During token exchange where an authorization code is exchanged for an access token and a refresh token, the same code can be used more than once. This happens if more requests are issued in parallel.
This PR adds a
.select_for_update
so only the first attempt goes through.Fixes #410.