Skip to content

Commit

Permalink
Remove Task allocation from AadIssuerValidator (#2584)
Browse files Browse the repository at this point in the history
There's no need to await this task just to return its result. We can just return the underlying Task from configurationManager.GetBaseConfigurationAsync.
  • Loading branch information
eerhardt authored May 9, 2024
1 parent 4228935 commit 0974668
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -524,12 +524,12 @@ private static ProtocolVersion GetProtocolVersion(string aadAuthority)
return ProtocolVersion.V1;
}

private static async Task<BaseConfiguration> GetBaseConfigurationAsync(BaseConfigurationManager configurationManager, TokenValidationParameters validationParameters)
private static Task<BaseConfiguration> GetBaseConfigurationAsync(BaseConfigurationManager configurationManager, TokenValidationParameters validationParameters)
{
if (validationParameters.RefreshBeforeValidation)
configurationManager.RequestRefresh();

return await configurationManager.GetBaseConfigurationAsync(CancellationToken.None).ConfigureAwait(false);
return configurationManager.GetBaseConfigurationAsync(CancellationToken.None);
}

/// <summary>Gets the tenant ID from a token.</summary>
Expand Down

0 comments on commit 0974668

Please sign in to comment.