Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Commit

Permalink
Merge pull request #4951 from IdentityServer/dom/fix-consumed-time
Browse files Browse the repository at this point in the history
Add null check before setting consumedTime
  • Loading branch information
brockallen committed Oct 7, 2020
2 parents 2ba07d3 + b4c3b3c commit 60f406e
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,11 @@ public virtual async Task<string> UpdateRefreshTokenAsync(string handle, Refresh
Logger.LogDebug("Token usage is one-time only. Setting current handle as consumed, and generating new handle");

// flag as consumed
refreshToken.ConsumedTime = Clock.UtcNow.UtcDateTime;
await RefreshTokenStore.UpdateRefreshTokenAsync(handle, refreshToken);
if (refreshToken.ConsumedTime == null)
{
refreshToken.ConsumedTime = Clock.UtcNow.UtcDateTime;
await RefreshTokenStore.UpdateRefreshTokenAsync(handle, refreshToken);
}

// create new one
needsCreate = true;
Expand Down

0 comments on commit 60f406e

Please sign in to comment.