fromStrategy
Converts a strategy string to the corresponding OAuthProvider.
This convenience function is primarily used to convert strategy strings from com.clerk.network.model.environment.UserSettings.SocialConfig.strategy into type-safe OAuthProvider enum values. This is useful when processing configuration data or API responses that contain strategy strings.
Return
The corresponding OAuthProvider enum value.
Parameters
strategy
The OAuth strategy string to convert (e.g., "oauth_google", "oauth_github"). The strategy string should match one of the supported provider strategies.
Throws
If no matching provider is found for the given strategy string.
Example usage:
val provider = OAuthProvider.fromStrategy("oauth_google") // Returns OAuthProvider.GOOGLE
val githubProvider = OAuthProvider.fromStrategy("oauth_github") // Returns OAuthProvider.GITHUB
Content copied to clipboard