useOAuth()
The useOAuth()
hook is used to create a new OAuth flow. It can be used in both web and native apps.
Parameters
- Name
strategy
- Type
OAuthStrategy
- Description
The strategy corresponding to the OAuth provider. For example:
oauth_facebook
,oauth_github
, etc.
- Name
redirectUrl?
- Type
string
- Description
The URL or path to redirect to after the OAuth flow is complete.
- Name
unsafeMetadata?
- Type
SignUpUnsafeMetadata
- Description
Unsafe metadata to be passed to the OAuth provider.
Returns
The useOAuth()
hook returns the startOAuthFlow()
method, which you can use to initiate the OAuth flow.
The startOAuthFlow()
method has the following signature:
It accepts the following parameters (StartOAuthFlowParams
):
- Name
redirectUrl?
- Type
string
- Description
The URL or path to redirect to after the OAuth flow is complete.
- Name
unsafeMetadata?
- Type
SignUpUnsafeMetadata
- Description
Unsafe metadata to be passed to the OAuth provider.
The following example demonstrates how to create a custom OAuth sign-in flow for Google accounts.
Feedback
Last updated on