Skip to main content

Type Alias: AuthProps

AuthProps = Pick<AuthCoreProps, "signUpTerms" | "logo" | "layout"> & object

Defined in: react-auth-cognito/src/Auth.tsx:233

Type Declaration​

autoSignInAfterSignUp?​

optional autoSignInAfterSignUp?: boolean

Sign the user in right after they confirm their sign-up code, instead of sending them back to the sign-in screen to type the password again. Defaults to false.

initialScreen?​

optional initialScreen?: AuthScreen

The screen shown first, e.g. { value: 'signUp' } for a sign-up link. Read on mount only, like useState's initial value.

onAuthEvent?​

optional onAuthEvent?: (event) => void

Called on every screen the user sees and on the outcome of every authentication action, failures included — the user mistakes onError skips (wrong password, wrong code) are reported here. Meant for analytics: the event never holds what the user typed.

Parameters​

ParameterType
eventAuthEvent

Returns​

void

onError?​

optional onError?: (error) => void

Callback function invoked when an error occurs during authentication operations. Receives the error object that was caught.

Parameters​

ParameterType
errorError

Returns​

void

socialProviders?​

optional socialProviders?: SocialProvider[]

Federated identity providers to offer alongside email/password. Each one must also be configured on the Cognito user pool and app client, and the app's Amplify config must declare Auth.Cognito.loginWith.oauth.