Browse Source

WIP: Google OAuth

sou 8 years ago
parent
commit
a5070b7b4b
1 changed files with 3 additions and 1 deletions
  1. 3 1
      lib/routes/login-passport.js

+ 3 - 1
lib/routes/login-passport.js

@@ -246,11 +246,13 @@ module.exports = function(crowi, app) {
     }
 
     passport.authenticate('google', {
-      scope: ['profile']
+      access_type: 'offline',
+      scope: ['profile', 'email'],
     })(req, res);
   };
 
   const loginPassportGoogleCallback = function(req, res, next) {
+    // enable google+ api and then this works
     passport.authenticate('google', {failureRedirect: '/login'}, (request, response) => {
       ExternalAccount.findOrRegister(
         'google',