Email Passwordless Login with Web3Auth
Create a Email Passwordless verifier
-
Go to the Web3Auth dashboard and select your project. Click on the
Custom Authentication
tab, then click on theCreate Verifier
button to create a new verifier.
-
Give a unique name to your verifier in the
Verifier Identifier
field. e.g.,email-passwordless-verifier
. -
From the list of Login Providers, select
Social Login Providers
and Select Email Passwordless from the dropdown list.
- Finally, click on the
Create
button to create the Email Passwordless verifier.
It typically takes 5-10 minutes for the verifier to go live. Once deployed & live, you'll receive an email and the dashboard will display the 'Live' status for the verifier.
Example
- Modal SDK
- No Modal SDK
import { AuthAdapter } from "@web3auth/auth-adapter";
// Create AuthAdapter instance once you have created Web3Auth instance
const authAdapter = new AuthAdapter({
adapterSettings: {
loginConfig: {
// Email Passwordless login
email_passwordless: {
verifier: "w3a-email-passwordless-demo", // Pass your verifier name here
typeOfLogin: "email_passwordless",
clientId, // Pass the Web3Auth `Client ID` here.
},
},
},
});
// Configure the adapter with Web3Auth
web3authInstance.configureAdapter(authAdapter);
// Initialize Modal
await web3authInstance.initModal();
// Login with Email Passwordless
await web3authInstance.connect();
import { AuthAdapter } from "@web3auth/auth-adapter";
// Create AuthAdapter instance once you have created Web3AuthNoModal instance
const authAdapter = new AuthAdapter({
adapterSettings: {
uxMode: "redirect",
loginConfig: {
email_passwordless: {
verifier: "w3a-email-passwordless-demo", // Pass your verifier name
typeOfLogin: "email_passwordless",
clientId, // Pass the Web3Auth `Client ID` here.
},
},
},
});
// Configure the adapter with Web3AuthNoModal web3authNoModalInstance.configureAdapter(authAdapter);
// Initialize await web3authNoModalInstance.init();
// Login with Email Passwordless // focus-start await
web3authNoModalInstance.connectTo(WALLET_ADAPTERS.AUTH, {
loginProvider: "email_passwordless",
extraLoginOptions: { login_hint: email.trim() },
}); // focus-end