Skip to content

Commit

Permalink
Throw if refresh/access token null on refresh.
Browse files Browse the repository at this point in the history
  • Loading branch information
drasticactions committed Sep 13, 2024
1 parent b8313f4 commit 4302218
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/FishyFlip/OAuth2SessionManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,12 @@ public void Dispose()
var refreshResult = await this.oidcClient.RefreshTokenAsync(this.session!.RefreshJwt, backChannelParameters: null, scope: null, cancellationToken: cancellationToken);
if (refreshResult.IsError)
{
this.logger?.LogError($"Failed to refresh token: {refreshResult.Error} {refreshResult.ErrorDescription}");
throw new OAuth2Exception($"Failed to refresh token: {refreshResult.Error} {refreshResult.ErrorDescription}");
}

if (this.session is null)
{
throw new NullReferenceException("Session should not be null if RefreshToken handler is enabled");
throw new OAuth2Exception("Session should not be null if RefreshToken handler is enabled");
}

lock (this.session)
Expand Down

0 comments on commit 4302218

Please sign in to comment.