Skip to content

Make name field of _UserInfo nullable. Fix #3424#3442

Merged
jonasfj merged 1 commit into
dart-lang:masterfrom
talisk:master
May 31, 2022
Merged

Make name field of _UserInfo nullable. Fix #3424#3442
jonasfj merged 1 commit into
dart-lang:masterfrom
talisk:master

Conversation

@talisk

@talisk talisk commented May 31, 2022

Copy link
Copy Markdown
Contributor

Fix #3424 .

The PR #3427 only fix the dart error. But actually pub cannot retrieve the user info.

As @bsutton said.

The symptom is that the 'name' field is not being returned by the google auth mechanism.
I've tried pub logout and then pub login with the same results.
Is there some chance that google no longer return the 'name' field in the user info response?

Reading the google documentation:
https://developers.google.com/identity/protocols/oauth2/openid-connect#server-flow
name - The user's full name, in a displayable form. Might be provided when: The request scope included the string "profile"
The ID token is returned from a token refresh. When name claims are present, you can use them to update your app's user records.

Note that this claim is never guaranteed to be present.
Note the last sentence.

We should make the name filed nullable.

@jonasfj jonasfj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r+

@jonasfj jonasfj merged commit 6c63504 into dart-lang:master May 31, 2022
jonasfj pushed a commit that referenced this pull request May 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dart pub login fails to write dart/pub-credentials.json after successful authentication

2 participants