Lesson notes
How it works
How passwordless login works
With passwordless login, a member enters their email and Memberstack emails them a six-digit code. They type the code into the same form and they're in. The code expires after 10 minutes. There's no password to forget, and members you add without a password through the dashboard, Make or Zapier can log in this way too.
Passwordless forms are their own forms. The standard signup and login components don't work with it, so use the passwordless components from the Components page in your dashboard. Filter by Passwordless and copy one for signup and one for login.
The attributes on a passwordless form
The components come with these attributes set. If you build your own, add them yourself. The login form has data-ms-form="passwordless-login" and the signup form has data-ms-form="passwordless-signup". The email input has data-ms-member="email" and the code input has data-ms-member="token". A div around the code input has data-ms-passwordless="step-2". Memberstack shows it once a valid email is entered, so set it to display none in Webflow. It has to be in the same form, not on another page. On the submit button, data-ms-passwordless-button="YOUR_TEXT" replaces the button text after the email step.
To offer password login too, build both kinds of form and switch between them with Webflow interactions or separate pages.
- Copy a passwordless signup component from Components and paste it on your signup page.
- Set the step-2 element to display none.
- Copy a passwordless login component and paste it on your login page.
- Publish and sign up with a new email to test the code.
Customizing the email and the pre-built modals
Edit the code email in Settings, Emails, under Passwordless Login / Signup Email. You can change the reply-to email, subject, header, content and footer. The logo and primary colour come from Settings, Design.
If you use Memberstack's pre-built modals, go to Settings, Auth Providers and click Configure on passwordless. Switch on Enable in Pre-built UI, choose whether passwordless should be the default and save. Any button with data-ms-modal="login" or data-ms-modal="signup" then offers the code option, and members can still choose a password.