I'm trying to implement google sign-in/ sign-up for my web app but I'm getting the following error:
GooglePlusAPIError: Project [project#] is not found and cannot be used for API calls.
This is my auth setup:
'googleAuth' : {
'clientID' : '***********',
'clientSecret' : '***********',
'callbackURL' : 'http://localhost:8080/auth/google/callback'
}
I've created the app on the google developer console and set the redirect URI to the same as that mentioned in the above auth setup. For good measure, here's my strategy for google signup:
passport.use(new GoogleStrategy({
clientID : configAuth.googleAuth.clientID,
clientSecret : configAuth.googleAuth.clientSecret,
callbackURL : configAuth.googleAuth.callbackURL,
},
function(token, refreshToken, profile, done) {
process.nextTick(function() {
User.findOne({ 'google.id' : profile.id }, function(err, user) {
if(err)
return done(err);
if(user) {
// if a user is found log them in
return done(null, user);
} else {
// if no user, create it
var newUser = new User();
newUser.google.id = profile.id;
newUser.google.token = token;
newUser.google.name = profile.displayName;
newUser.google.email = profile.emails[0].value;
//save user
newUser.save(function(err) {
if(err)
throw err;
return done(null, newUser);
});
}
});
});
}));
I've trawled the internet for answers and find nothing at all. Can anybody help?
via DaveB1
No comments:
Post a Comment