The SignIn container helps render different screens that enable the customer to log in to an account. The container supports multiple scenarios, including standard logins for existing accounts and for accounts that are process of being confirmed.
If customers are required to confirm an email address to create an account, the Stores > Configuration > Customers > Customer Configuration > Create New Account Options > Require Emails Confirmation setting in the Commerce Admin must be set to Yes.
Simple login
The standard login screen can be displayed when an account has already been created or confirmed, or when email configuration is disabled.
Upon a successful login, the SignIn container renders the SuccessNotification container. This container can be overridden using the Slots API.
Alternatively, if you pass the routeRedirectOnSignIn property, the user will be redirected to the specified URL after successful login. (Neither SuccessNotification nor Slot content will be rendered.)
SignIn standard login container
Log in to an unconfirmed account
This scenario is applicable when email confirmation has been enabled, and the user has created an account, but has not confirmed their email.
If the user attempts to log in with credentials for an unconfirmed account, they will see a custom notification allowing them to resend the confirmation email. When the user clicks on the Resend confirmation email link shown below, Commerce sends a new confirmation email to the user.
SignIn standard login container
Confirmation from email
The SignIn container processes email confirmations when users click on the confirmation link sent to their email. The link format is:
Email confirmation is enabled in the Commerce Admin.
The user has created an account and received the email confirmation link.
The user clicks on the link and gets redirected to the email confirmation page with the SignIn drop-in.
SignIn standard login container
SignIn configurations
The SignIn container provides the following configuration options:
Option
Type
Req?
Description
slots
SuccessNotification
No
Allows passing the SuccessNotification container or custom component rendered on successful sign-in if routeRedirectOnSignIn is not provided.
labels
Record<string, string>
No
Text that describes the container
formSize
default | small
No
Controls form paddings and spacing. Use "small" to embed the form in small layout containers like a dropdown in the header.
renderSignUpLink
boolean
No
Controls the visibility of the “Sign up” link next to the “Forgot Password” link.
initialEmailValue
string
No
Allows passing an initial value for the email input (prefilled sign-in form).
enableEmailConfirmation
boolean
No
Determines if this container is used to handle email confirmation.
hideCloseBtnOnEmailConfirmation
boolean
No
Controls the visibility of the “Close” button on the email confirmation view.
routeRedirectOnEmailConfirmationClose
function
No
Determines where the user is redirected when the “Close” button on the email confirmation view is clicked.
routeForgotPassword
function
No
Determines where the “Forgot password?” link redirects the customer.
routeSignUp
function
No
Determines where the “Sign up” link redirects the customer (link visibility is based on the renderSignUpLink property).
routeRedirectOnSignIn
function
No
Determines the page to which the user should be redirected after sign-in. If provided, the user won’t be redirected to the SuccessNotification container or any slot-defined override.
onSuccessCallback
function
No
Callback executed when the user successfully logs in, receiving userName and status as parameters.
onErrorCallback
function
No
Callback executed when an error occurs, receiving the error object as a parameter.
onSignUpLinkClick
function
No
Executed on clicking the “Sign up” link before redirect (link visibility is based on the renderSignUpLink property).
Example
The following example renders the SignIn container.