Skip to content
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

No display name for users signed up by email in Firebase Auth #725

Closed
Johnson145 opened this issue Jul 9, 2019 · 17 comments
Closed

No display name for users signed up by email in Firebase Auth #725

Johnson145 opened this issue Jul 9, 2019 · 17 comments
Assignees
Labels

Comments

@Johnson145
Copy link
Contributor

My environment

  • Xcode version: 10.2.1
  • Firebase SDK version: 6.3.0
  • Firebase Component: Auth
  • Component version: 6.1.2

Problem description

I'm using the pre-built UI of Firebase Auth. When a user signs up by email, the UI lets him/her enter the user name (label asks for the first and last name combined as one input). However, I can't see a way to get that information later on. Instead, the firebaseUser.displayName is nil for those users. That's not the way it's meant to be, is it?

@morganchen12 morganchen12 transferred this issue from firebase/firebase-ios-sdk Jul 9, 2019
@morganchen12
Copy link
Contributor

Are there any errors in console when signing in? Can you see those users' names in Firebase console?

@Johnson145
Copy link
Contributor Author

Thanks for your quick reply!

I don't get any error message. Everything else is working just fine: the user is logged in and I can access other information like the email address.

I can see the user along with e.g. the email address in the Firebase console, too. However, the Firebase console does not show the (display) name of any user in the first place, does it?

@morganchen12
Copy link
Contributor

Good point, it doesn't. Can you see the display name in the user's provider info? Also, what version of FirebaseUI are you using?

@Johnson145
Copy link
Contributor Author

No, the provider info does not provide that name either. It does contain only the providerID ("password"), the email and the userID which equals the email. The rest is nil.

I'm including the following FirebaseUI pods:

pod 'FirebaseUI/Auth'
pod 'FirebaseUI/Email'
pod 'FirebaseUI/Google'
pod 'FirebaseUI/Facebook'
pod 'FirebaseUI/Phone'

All of them using the latest version 8.0.2.

@morganchen12
Copy link
Contributor

Sounds like a bug. We'll investigate.

@Johnson145
Copy link
Contributor Author

Just found this issue: #262. Looks like my issue is a duplicate of the former one. The bug still seems to exist though.

Furthermore, I can confirm that firebaseUser.displayName seems to get updated later on. I managed to get the correct value in the didSignInWith callback. It's still not in sync with the provider data though. The latter does still contain the old displayName instead of the one provided when signing up by email. In each case, all of these values should get updated before triggering any callback in the first place, right?

@morganchen12 morganchen12 self-assigned this Jul 16, 2019
@andynovak12
Copy link

@morganchen12 I am also experiencing this issue. Is there an ETA of when this will be resolved?

@morganchen12
Copy link
Contributor

Hey, unfortunately I haven't had time to make significant contributions to this SDK in a while. We're in the middle of some reshuffling that will hopefully get us some more contributors to FirebaseUI, but between the reporting of this bug and now there hasn't been any progress made.

Sorry for the delays.

@VedankPande
Copy link

VedankPande commented May 10, 2020

I've been getting the same problem, any updates from Google/Firebase?
It was working just this morning though and the only change I made since then is update some dependencies. Could that be the issue?

@SharpBCD
Copy link

Problem is still there. Any updates?
The name is required in the interface for creating a user but it is not available when getting the user back in admin

@yuchenshi
Copy link
Member

@rosalyntan Would you mind taking a look at this one?

@morganchen12
Copy link
Contributor

This should be fixed in the latest version of FirebaseUI. Please let me know if that's not the case.

@romrell4
Copy link

romrell4 commented Nov 3, 2022

I'm still seeing the error in FirebaseUI 12 @morganchen12 :( After logging in using the email provider, the displayName is nil. If I log out and back in, it is then set to the correct value from the UI - so it sounds like the same race case discussed above

@AntonOliinyk-TomTom
Copy link

Have the same issue with the Apple id login. When I call Auth.auth().signIn(with: credentials) I got the result, but user.displayName is always nil. If I use auth with Google credentials it works just fine.

@alsiesta
Copy link

Have the same issue. Funny though, that when using connectAuthEmulator the locally emulated console does show the displayName and it can be easily edited.

@cmederos
Copy link

Still an issue at the end of 2023. Especially annoying considering the FIRAuthStateDidChangeListenerHandle does not include profile updates, nor is there an equivalent listener.

I've only been able to work around this by placing a delay in the the body of the auth listener if the display name is empty.

However, the complexity around the listener, delay, and rendering the UI accordingly is greater than the complexity avoided by using the prebuilt UI. We could use a better solution here...

  • a change in the firebase code to await the profile update when performing a user creation with an email provider?
  • a method in the SDK to request the user details from the firebase backend?
  • at least a mention in the docs that this async issue exists?
  • removing the name field from the prebuilt form so that we can add it in our apps ourselves?

@morganchen12
Copy link
Contributor

@cmederos the issue you're describing sounds like it originates in the upstream Firebase SDK. Please file a new issue there instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests