Skip to content

Commit

Permalink
- Try to fix OAuth2: Change oidc username to preferred_username.
Browse files Browse the repository at this point in the history
Thanks to xet7 !
  • Loading branch information
xet7 committed Sep 22, 2018
1 parent b21a0ca commit 734e4e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion models/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ if (Meteor.isServer) {
if (user.services.oidc) {
const email = user.services.oidc.email.toLowerCase();

user.username = user.services.oidc.username;
user.username = user.services.oidc.preferred_username;
user.emails = [{ address: email, verified: true }];
const initials = user.services.oidc.fullname.match(/\b[a-zA-Z]/g).join('').toUpperCase();
user.profile = { initials, fullname: user.services.oidc.fullname };
Expand Down

0 comments on commit 734e4e5

Please sign in to comment.