Skip to content

Commit

Permalink
use Google OAuth2Strategy to avoid error that key $t must not start w…
Browse files Browse the repository at this point in the history
…ith '$'
  • Loading branch information
memolog committed Sep 4, 2013
1 parent 39db681 commit 0116b34
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions config/passport.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var mongoose = require('mongoose'),
TwitterStrategy = require('passport-twitter').Strategy,
FacebookStrategy = require('passport-facebook').Strategy,
GitHubStrategy = require('passport-github').Strategy,
GoogleStrategy = require('passport-google-oauth').Strategy,
GoogleStrategy = require('passport-google-oauth').OAuth2Strategy,
User = mongoose.model('User');


Expand Down Expand Up @@ -142,8 +142,8 @@ module.exports = function(passport, config) {

//Use google strategy
passport.use(new GoogleStrategy({
consumerKey: config.google.clientID,
consumerSecret: config.google.clientSecret,
clientID: config.google.clientID,
clientSecret: config.google.clientSecret,
callbackURL: config.google.callbackURL
},
function(accessToken, refreshToken, profile, done) {
Expand Down
8 changes: 5 additions & 3 deletions config/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,13 @@ module.exports = function(app, passport, auth) {
//Setting the google oauth routes
app.get('/auth/google', passport.authenticate('google', {
failureRedirect: '/signin',
scope: 'https://www.google.com/m8/feeds'
scope: [
'https://www.googleapis.com/auth/userinfo.profile',
'https://www.googleapis.com/auth/userinfo.email'
]
}), users.signin);
app.get('/auth/google/callback', passport.authenticate('google', {
failureRedirect: '/signin',
scope: 'https://www.google.com/m8/feeds'
failureRedirect: '/signin'
}), users.authCallback);

//Finish with setting up the userId param
Expand Down

0 comments on commit 0116b34

Please sign in to comment.