Logging in with Passwordless SMS Resets the User's Assigned Name

Problem statement

A Passwordless SMS is created with user’s phone number saved as their ‘name’ attribute. When updating a passwordless SMS user’s ‘name’ attribute to something else after they sign up, if a user logs in after that, it resets the ‘name’ attribute back to the phone number.

Steps to reproduce

  1. Go into Auth0 Dashboard, User Management, Users.
  2. View Account Details for the existing Passwordless SMS User
  3. Change ‘Name’ from ‘+1234567890’ to ‘Test Name’
  4. Log in again with Passwordless SMS login
  5. Refresh the Auth0 Account Details page
  6. Name is no longer ‘Test Name’ instead ‘+1234567890’

Cause

The Passwordless login with SMS does not associate with a user’s name in the login flow i.e. Universal Login only presents the user with a phone number field as a result, the phone number becomes the user’s name as far as the user profile goes.

If a Passwordless SMS user’s name is changed to something else, logging back in via SMS will have the same effect and set the name attribute to the phone number.

Solution

To save the user’s name in the user profile, instead of using the ‘name’ attribute, save it under their user_metadata.

Related References: