Email or Phone Number Registration with Passwordless Login

You can implement passwordless login with email addresses and phone numbers. Create a Login Discovery page from Experience Workspaces. Then you can customize the LoginDiscovery handler with Apex.

Required Editions

Available in: Enterprise, Performance, Unlimited, and Developer Editions

Implementation Steps

  • Customize the LoginDiscovery Handler
    After you create a Login Discovery page, continue setting up passwordless login with an email address or phone number by modifying the autogenerated Apex LoginDiscovery handler. By customizing the handler, you control the login process while Salesforce handles verification. The handler finds users based on the identifier that they provide on the login page, such as their email address. It then checks which verification methods the user has previously registered. The controller logs in the user by whichever method is configured.
  • Create Custom Error Messages in the Login Discovery Handler
    If a user makes a mistake when trying to log in to your site, the Apex handler displays a generic error message. You can customize the error message that appears on the login page using the Auth.DiscoveryCustomErrorException exception.