Skip to content

Commit

Permalink
AddIssuerValidator return ValueTask.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brent Schmaltz committed Sep 4, 2023
1 parent 160f6ad commit 54ba505
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,10 @@ public string Validate(
SecurityToken securityToken,
TokenValidationParameters validationParameters)
{
return ValidateAsync(issuer, securityToken, validationParameters).GetAwaiter().GetResult();
ValueTask<string> vt = ValidateAsync(issuer, securityToken, validationParameters);
return vt.IsCompletedSuccessfully ?
vt.Result :
vt.AsTask().GetAwaiter().GetResult();
}

/// <summary>
Expand All @@ -145,7 +148,7 @@ public string Validate(
/// <exception cref="ArgumentNullException"> if <paramref name="securityToken"/> is null.</exception>
/// <exception cref="ArgumentNullException"> if <paramref name="validationParameters"/> is null.</exception>
/// <exception cref="SecurityTokenInvalidIssuerException">if the issuer is invalid or if there is a network issue. </exception>
internal async Task<string> ValidateAsync(
internal async ValueTask<string> ValidateAsync(
string issuer,
SecurityToken securityToken,
TokenValidationParameters validationParameters)
Expand Down

0 comments on commit 54ba505

Please sign in to comment.