Access Auth State
Access Authenticated User
Trigger Transitions
Example
Here's an example that uses the toForgotPassword
trigger transition, to create a custom button. Note that example uses the Footer "slot" override.
Full API
These are readonly
contexts that represent the current auth state. Any unapplicable context
will be undefined
.
Name | Description | Type |
---|---|---|
user | Current signed in user | AuthUser |
route | Name of the auth flow user is in | string |
error | Any error returned from service API call | string |
validationErrors | Any form validation errors found. Maps each error message to respective input name. | Record<string, string> |
hasValidationErrors | Whether there are any form validation errors | boolean |
isPending | Whether service API call is in progress | boolean |
codeDeliveryDetail | Provides detail on where confirm sign up code is sent to. | CodeDeliveryDetail |
These helper functions trigger transition to another route
. Note that any invalid transition (e.g. sign-in
to authenticated
directly) will be no-op.
Name | Description | Type |
---|---|---|
toSignIn | Transitions to signIn . Allowed from signUp , confirmSignUp , confirmSignIn , setupTotp , forgotPassword , and confirmResetPassword | () => void |
toSignUp | Transitions to signUp . Allowed from signIn . | () => void |
toForgotPassword | Transitions to forgotPassword . Allowed from signIn . | () => void |
skipVerification | Skips verification process. Allowed from verifyUser and confirmVerifyUser | () => void |