This hook requires the user to be authenticated.
Overview
useOAuthIdentities fetches the list of OAuth identities linked to the current user’s account and provides a function to unlink them. Use it to build a connected accounts settings page.
Usage Example
Returns
Array of OAuth identities linked to the current user. Initially empty; call
fetchIdentities to populate.Async function that fetches the identities list from the server and updates
local state. Returns
void.Async function that unlinks a specific identity. Accepts
{ identityId: string }.
On success, removes the identity from the local identities array. Fails
if it would be the last identity and the user has no password set.true while a fetch or unlink request is in progress.Error message from the most recent failed operation, or
null if no error.OAuthIdentity Type
| Property | Type | Description |
|---|---|---|
id | string | Unique identity ID (UUID) |
provider | string | OAuth provider name (e.g., "google", "github") |
providerAccountId | string | The user’s ID at the provider |
email | string | null | Email returned by the provider |
name | string | null | Name returned by the provider |
avatar | string | null | Avatar URL returned by the provider |
isVerified | boolean | Whether the provider marked the email as verified |
createdAt | string | ISO timestamp of when the identity was linked |

