useOAuthTokens
hook:useOAuthTokens
, you may include an onOAuthTokenGrant
callback.useOAuthTokens
hook is invoked must be mounted on the
component/page the user returns to after authorizing an OAuth flow in order for this callback to
execute.onOAuthTokenGrant
callback will execute after a user returns to the application from an OAuth flow authorization. This happens in 3 cases:reauthorize
call is invoked, and the user authorizes an existing OAuth account.provider
: the OAuth provider, is one of 'apple'
, 'discord'
, 'github'
, 'google'
, 'linkedin'
, 'spotify'
, 'tiktok'
, 'instagram'
, and 'twitter'
.accessToken
: the OAuth access tokenaccessTokenExpiresInSeconds
: the number of seconds until the OAuth access token expiresrefreshToken
: the OAuth refresh tokenrefreshTokenExpiresInSeconds
: the number of seconds until the OAuth refresh token expires. If the refresh token is present and this field is undefined, it is assumed that the refresh token does not have an expiration datescopes
: the list of OAuth scopes the access token is approved for.reauthorize
method, which will allow a user to re-authorize an existing OAuth account in order to retrieve more up-to-date OAuth tokens and account metadata.