- This function first checks if there is an existing sub-organization associated with the OIDC token.
- If a sub-organization exists, it proceeds with the OAuth login flow.
- If no sub-organization exists, it creates a new sub-organization and completes the sign-up flow.
- Optionally accepts a custom OAuth provider name, session key, and additional sub-organization creation parameters.
- Handles session storage and management, and supports invalidating existing sessions if specified.
Package: core
Defined in: clients/core.ts:1678
A promise that resolves to an object containing:
sessionToken: the signed JWT session token.action: whether the flow resulted in a login or signup (AuthAction).