- This function first verifies the OTP code for the provided contact and OTP type.
- If the contact is not associated with an existing sub-organization, it will automatically create a new sub-organization and complete the sign-up flow.
- If the contact is already associated with a sub-organization, it will complete the login flow.
- Supports passing a custom public key for authentication, invalidating existing session, specifying a session key, and providing additional sub-organization creation parameters.
- Handles both email and SMS OTP types.
Package: core
Defined in: clients/core.ts:1586
A promise that resolves to an object containing:
sessionToken: the signed JWT session token.verificationToken: the OTP verification token.action: whether the flow resulted in a login or signup (AuthAction).