authentification oauth2

This commit is contained in:
Allemand Sylvain 2018-04-09 16:49:07 +02:00
parent c115046a7c
commit 1c8a00943c
3 changed files with 31 additions and 0 deletions

View file

@ -459,6 +459,17 @@ if (Meteor.isServer) {
return user;
}
if (user.services.oidc) {
user.username = user.services.oidc.username;
user.emails = [{
address: user.services.oidc.email.toLowerCase(),
verified: false,
}];
const initials = user.services.oidc.fullname.match(/\b[a-zA-Z]/g).join('').toUpperCase();
user.profile = { initials: initials, fullname: user.services.oidc.fullname };
}
if (options.from === 'admin') {
user.createdThroughApi = true;
return user;