Skip to content

Commit

Permalink
fix: handle new userinfo endpoint
Browse files Browse the repository at this point in the history
* `email_verified` can now be `verified_email`
* `sub` is now `id`
  • Loading branch information
MarshallOfSound authored Dec 21, 2018
1 parent 96a25f6 commit 5b3f943
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/profile/openid.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ exports.parse = function(json) {
}

var profile = {};
profile.id = json.sub;
profile.id = json.sub || json.id;
profile.displayName = json.name;
if (json.family_name || json.given_name) {
profile.name = { familyName: json.family_name,
givenName: json.given_name };
}
if (json.email) {
profile.emails = [ { value: json.email, verified: json.email_verified } ];
profile.emails = [ { value: json.email, verified: json.email_verified || json.verified_email } ];
}
if (json.picture) {
profile.photos = [{ value: json.picture }];
Expand Down

0 comments on commit 5b3f943

Please sign in to comment.