oauth module starts browser redirect flows for signing in (or signing up)
with a third-party provider, and for linking an additional provider to the current
user — plus reading and removing the user’s linked identities.
authorize and linkIdentity return only an authorizationUrl — not tokens.
Redirect the browser to that URL; the provider bounces back to Sublay’s callback,
which establishes the session and then redirects to your redirectAfterAuth. This
is why OAuth lives in the framework-agnostic SDK but not in the server-side
@sublay/node SDK.OAuthProvider): "google", "github", "apple", "facebook".
authorize
Begins an unauthenticated OAuth sign-in / sign-up flow and returns the URL to send the browser to (Sublay redirects it on to the provider).Where to send the user after the flow completes. Must be one of the project’s
allowed redirect URIs.
Promise<{ authorizationUrl: string }>
linkIdentity
Links a new OAuth provider to the current authenticated user and returns the URL to send the browser to. Sublay first shows a page naming the account the provider will be connected to, then continues to the provider. The user is taken from the auth token, never the body.Where to send the user after linking completes. Must be one of the project’s
allowed redirect URIs.
Promise<{ authorizationUrl: string }>
listIdentities
Lists the current user’s linked OAuth identities. Takes no arguments.Promise<{ identities: OAuthIdentity[] }>, where each OAuthIdentity
is { id, provider, providerAccountId, email, name, avatar, isVerified, createdAt }.
unlinkIdentity
Unlinks one of the current user’s OAuth identities by ID.Promise<{ success: boolean }>
The server refuses to remove the last remaining identity if the user has no
password set — otherwise they would be locked out.

