Skip to content

requireDisplayName with email link sign-in #713

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
emschwartz opened this issue May 27, 2020 · 6 comments · Fixed by #717
Closed

requireDisplayName with email link sign-in #713

emschwartz opened this issue May 27, 2020 · 6 comments · Fixed by #717
Labels
feature:auth feature:ui UI feature requests

Comments

@emschwartz
Copy link
Contributor

Is your feature request related to a problem? Please describe.
It is not completely obvious from the docs that setting requireDisplayName: true will have no effect if you also set signInMethod: firebase.auth.EmailAuthProvider.EMAIL_LINK_SIGN_IN_METHOD.

Describe the solution you'd like
It would be nice to be able to require the display name even if the user is signing up without a password.

Describe alternatives you've considered
If that's not possible, it would be worth clarifying the docs to emphasize that requireDisplayName will have no effect under this circumstance. It could also throw an error if you try to present both parameters at the same time.

Additional context
I'm using the email sign-in provider alongside a couple of others and the user's display name is shown next to their contributions. I liked the idea of using the email sign-in link to avoid having most users input a bad password, but not having the display name means that I'd need an additional step in the flow to make sure they set it after logging in.

@bojeil-google
Copy link
Contributor

We haven't seen requests for this. It would require an additional prompt after the link is clicked.
We document that it is only applicable to email / password sign-up already.
"Defines whether to require the user to provide a display name during email and password sign up."

We cannot throw an error as it would be a breaking change and could affect existing developers.

@emschwartz
Copy link
Contributor Author

Thanks for the response!

It would require an additional prompt after the link is clicked.

Could it have the field for First and Last Name above the email input, like when asking for the password? The only difference between the email link mode and the password mode in this case would be the presence of the password field.

Fair enough about throwing an error. Maybe log a warning to let you know that the requireDisplayName will be ignored in this mode?

I missed the "during email and password sign up" part of the docs on the first time through and only realized it after someone signed up with the email link and had no display name to show. Just to make sure no one else runs into this, I would suggest adding a sentence after that one to note that requireDisplayName has no effect when used with the email link method. (PR here)

Anyway, this is a minor issue. Thank you for your work on this project!

@marcus7777
Copy link

When I sign up with email/password I use:

image
and use:

// Create a user document when a new user is created
exports.create = functions.region('europe-west2').auth.user().onCreate(event => { 

//
to collect the displayName
but in the event I get:

{
   "uid":"4R4YxFP7LchBxe05w6xmZB0nKiF3",
   "email":"[email protected]",
   "emailVerified":false,
   "displayName":null,
   "photoURL":null,
   "phoneNumber":null,
   "disabled":false,
   "passwordHash":null,
   "passwordSalt":null,
   "tokensValidAfterTime":null,
   "metadata":{
      "creationTime":"2020-12-02T18:09:18Z",
      "lastSignInTime":"2020-12-02T18:09:18Z"
   },
   "customClaims":{
      
   },
   "providerData":[
      {
         "email":"[email protected]",
         "providerId":"password",
         "uid":"[email protected]"
      }
   ]
}

@starcrest
Copy link

Yes our project would really appreciate this option. As suggested by @emschwartz, we'd like the exact parallel to the way it works with email+password: Enter Email address --> Click Next --> Enter First & last name --> Click Next --> sends link to email.

This makes it easier to get up and running with a project that needs a displayName. And is sometimes clearer to the user than entering information on both sides of the email link. Thank you!

@mihaibulic2
Copy link

The lack of this feature is making me not use email link signups and it's a shame because otherwise it's great / this seems very easy to build into firebaseui :/

@jhuleatt jhuleatt added feature:auth feature:ui UI feature requests labels Jul 31, 2023
@sushantdhiman
Copy link

Congratulations on completing this issue without actually providing any useful resolution! It would be much better to keep this issue open and actually implement this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature:auth feature:ui UI feature requests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants