Amplify UI

Advanced Usage

Access Authenticator UI component state outside of the UI component

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.

NameDescriptionType
userCurrent signed in userAuthUser
routeName of the auth flow user is instring
errorAny error returned from service API callstring
validationErrorsAny form validation errors found. Maps each error message to respective input name.Record<string, string>
hasValidationErrorsWhether there are any form validation errorsboolean
isPendingWhether service API call is in progressboolean
codeDeliveryDetailProvides 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.

NameDescriptionType
toSignInTransitions to signIn. Allowed from signUp, confirmSignUp, confirmSignIn, setupTotp, forgotPassword, and confirmResetPassword() => void
toSignUpTransitions to signUp. Allowed from signIn.() => void
toForgotPasswordTransitions to forgotPassword. Allowed from signIn.() => void
skipVerificationSkips verification process. Allowed from verifyUser and confirmVerifyUser() => void

Amplify open source software, documentation and community are supported by Amazon Web Services.

© 2023 Amazon Web Services, Inc. and its affiliates. All rights reserved. View the site terms and privacy policy.

Flutter and the related logo are trademarks of Google LLC. We are not endorsed by or affiliated with Google LLC.