fix social auth scheme

closes #1734
This commit is contained in:
Berkeley Martinez
2015-08-12 20:09:15 -07:00
parent eb07cbfea6
commit 4b0a9bef0a
3 changed files with 53 additions and 55 deletions

View File

@ -159,7 +159,9 @@ export default function(UserIdent) {
}
if (!(/github/).test(provider)) {
user[getSocialProvider(provider)] = profile.username;
debug('setting social', provider, (/github/g).test(provider));
debug('profile username', profile.username);
user[provider] = profile.username;
}
// if user signed in with github refresh their info

View File

@ -72,25 +72,20 @@
"type": "string",
"default": ""
},
"linkedinProfile": {
"type": "string",
"default": ""
"linkedin": {
"type": "string"
},
"githubProfile": {
"type": "string",
"default": ""
"codepen": {
"type": "string"
},
"codepenProfile": {
"type": "string",
"default": ""
"twitter": {
"type": "string"
},
"twitterHandle": {
"type": "string",
"default": ""
"facebook": {
"type": "string"
},
"facebookProfile": {
"type": "string",
"default": ""
"google": {
"type": "string"
},
"completedBonfires": {
"type": [

View File

@ -11,6 +11,7 @@ var uuid = require('node-uuid'),
passportProviders = require('./passport-providers');
var setProfileFromGithub = require('./utils/auth').setProfileFromGithub;
var getSocialProvider = require('./utils/auth').getSocialProvider;
var generateKey =
require('loopback-component-passport/lib/models/utils').generateKey;
@ -67,7 +68,7 @@ var passportOptions = {
}
if (!(/github/).test(provider)) {
userObj[provider.split('-')[0]] = profile.username;
userObj[getSocialProvider(provider)] = profile.username;
}
if (/github/.test(provider)) {