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 values. This is useful when processing configuration data or API responses that contain strategy strings.
Return
The corresponding OAuthProvider value, preserving custom OAuth strategy keys.
Example usage:
val provider = OAuthProvider.fromStrategy("oauth_google") // Returns OAuthProvider.GOOGLE
val githubProvider = OAuthProvider.fromStrategy("oauth_github") // Returns OAuthProvider.GITHUBContent copied to clipboard
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. Custom and otherwise unrecognized OAuth strategies retain the complete string. Non-OAuth strategies return UNKNOWN.