♻️ Refactor OpenID: Phase 3: Async Flow Modernization
- Added async GetAuthorizationUrlAsync() methods to all OIDC providers - Updated base OidcService with abstract async contract and backward-compatible sync wrapper - Modified OidcController to use async authorization URL generation - Removed sync blocks using .GetAwaiter().GetResult() in Google provider - Maintained backward compatibility with existing sync method calls - Eliminated thread blocking and improved async flow throughout auth pipeline - Enhanced scalability by allowing non-blocking async authorization URL generation
This commit is contained in:
@@ -16,6 +16,11 @@ public class DiscordOidcService(
|
||||
protected override string DiscoveryEndpoint => ""; // Discord doesn't have a standard OIDC discovery endpoint
|
||||
protected override string ConfigSectionName => "Discord";
|
||||
|
||||
public override Task<string> GetAuthorizationUrlAsync(string state, string nonce)
|
||||
{
|
||||
return Task.FromResult(GetAuthorizationUrl(state, nonce));
|
||||
}
|
||||
|
||||
public override string GetAuthorizationUrl(string state, string nonce)
|
||||
{
|
||||
var config = GetProviderConfig();
|
||||
@@ -111,4 +116,4 @@ public class DiscordOidcService(
|
||||
Provider = ProviderName
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user