Auth0 client integration ready
This commit is contained in:
1 parent
3f9423e91d
commit
eca2e6deff
12 files changed
+614
-10
No files matched your search
+17
-1
@@ -73,7 +73,23 @@ const RootQuery = new GraphQLObjectType({
|
||||
args: {authId: {type: GraphQLString}},
|
||||
resolve(parent,args) {
|
||||
// Code to get data from data source.
|
||||
return User.findOne({authId: args.authId});
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
User.findOne({authId: args.authId}, (err, user) => {
|
||||
if(err) reject(err);
|
||||
else{
|
||||
if (user.authId === args.authId && user.authId !== undefined) {
|
||||
console.log(user );
|
||||
console.log(user.authId );
|
||||
console.log(args.authId );
|
||||
return resolve(user);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
},
|
||||
role: {
|
||||
|
||||
Reference in new issue
Block a user