quickstart-js icon indicating copy to clipboard operation
quickstart-js copied to clipboard

currentUser.displayName is null

Open nickleefly opened this issue 10 years ago • 18 comments

Browser: Chrome Browser version: 51.0.2704.84 Operating system: OSX Operating system version: 10.11.5

What steps will reproduce the problem: 1, signin with google, 2, create a post 3, go to firebase console, check database Tab, in posts, user-posts all don't have author field from written here

What is the expected result? should have author field

What happens instead of that? no author field

nickleefly avatar Jun 16 '16 08:06 nickleefly

Hey @nickleefly we currently have a bug in Firebase auth where we do not get a username for certain users. It seems to be users who have not enabled Google+ on their accounts. Can you try signing i https://friendly-pix.com ? If you see yourself as "Anonymous" it means we don't have your username.

nicolasgarnier avatar Jun 16 '16 12:06 nicolasgarnier

@nicolasgarnier it gives "Anonymous", I tried with personal account, it shows the correct name. But with google for work account, It gives Anonymous. from google plus, "it says Google+ is not available for your organization" I think the problem is the our company disabled google+.

nickleefly avatar Jun 20 '16 02:06 nickleefly

So we currently have a bug with Firebase Auth where accounts that do not have Google+ enabled do not get the displayName field populated. We know that's bad as this is a lot of users and this is being currently investigated. I'm hoping for a server side fix soon. Sorry about that unfortunately there is nothing you can do on your side to work around this at this point (except enabling G+ on your domain and then on your account but it's definitely a bug on our side to begin with).

nicolasgarnier avatar Jun 23 '16 15:06 nicolasgarnier

+1

Pingendo avatar Jun 24 '16 11:06 Pingendo

@nicolasgarnier I enabled G+ on my account and I still see "undefined" for the author and comment section. I am on Chrome. screen shot 2016-06-25 at 11 49 09 am

aruld avatar Jun 25 '16 16:06 aruld

@aruld Did you use the same app and same account as before? I think you'll have to delete the account from your app's accounts list (use the Firebase Console > Auth for this) for your account to be updated properly.

nicolasgarnier avatar Jun 25 '16 17:06 nicolasgarnier

@nicolasgarnier Deleting the account did the trick. Thank you.

aruld avatar Jun 25 '16 17:06 aruld

@aruld I've deleted an account to test if I'll get the displayName, but for this didn't solve the problem in my case...

ghost avatar Jun 25 '16 22:06 ghost

@arcodebonte do you see your display name when logging into this app using your Google account: https://friendly-pix.com ?

aruld avatar Jun 25 '16 23:06 aruld

@aruld thanks for your fast reply! When I log into friendly-pix.com my profilepic is shown, but besides it it displays 'Anonymous'...

ghost avatar Jun 27 '16 13:06 ghost

@arcodebonte ok. do you have Google+ enabled on your Google account?

aruld avatar Jun 27 '16 14:06 aruld

@aruld I've tried it with a student-account. I work in primary education so my students are not allowed (by Google) to use Google+. Is Google+ necessary to get the username?

ghost avatar Jun 27 '16 14:06 ghost

@arcodebonte It is required at least for now, check this out: https://github.com/firebase/quickstart-js/issues/19#issuecomment-228083324

aruld avatar Jun 27 '16 14:06 aruld

@aruld thanks for your patience! And sorry that I missed comment 19!

ghost avatar Jun 27 '16 14:06 ghost

If you are using the scope for Google+ (https://www.googleapis.com/auth/plus.login) and the user doesn't have a Google+ account, but only the default Google Account the displayName will be null.

By using the non-Google+ scope(https://www.googleapis.com/auth/userinfo.profile) you can retrieve the user displayName if the user doesn't have a Google+ account.

Just remember that If the user is already registered on your Firebase project you should have to delete him to see the changes.

VyMajoris avatar Jul 23 '16 21:07 VyMajoris

I'm having this problem right now.... I took the steps but it continues to be a problem

ramonpaolo avatar Oct 24 '20 14:10 ramonpaolo

i'm having this problem

khldon123 avatar Mar 19 '22 19:03 khldon123

Years later... Google+ is long dead, how are events still showing a displayName of "NULL" in 2023?!

NoiseEee avatar Jan 17 '23 17:01 NoiseEee