-
Notifications
You must be signed in to change notification settings - Fork 280
Description
Is your feature request related to a problem? Please describe.
I'm facing to a concurrent requests that for the same user need to refresh the access token. All is good for the first request, but the second that uses the same refresh token has been rejected and in consequence, write null in the database. The access token and the new refresh are lost.
Describe the solution you'd like
Add a version field to the StoredCredential object. At this time this object cannot be overridden because it is declared as final class. This new field permit to implement a optimistic lock in my DataStoreFactory.
Result:
The second request it want to insert null with version 1, will be rejected because in database the first request put the new token with version 2. The right access token and refresh token aren't lost.