Add support of google signin

This commit is contained in:
Cheng-Han, Wu 2016-05-21 22:48:00 +08:00
parent 900141daff
commit 6405bb5056
10 changed files with 47 additions and 8 deletions

View file

@ -6,6 +6,7 @@ var TwitterStrategy = require('passport-twitter').Strategy;
var GithubStrategy = require('passport-github').Strategy;
var GitlabStrategy = require('passport-gitlab2').Strategy;
var DropboxStrategy = require('passport-dropbox-oauth2').Strategy;
var GoogleStrategy = require('passport-google-oauth20').Strategy;
//core
var config = require('./config.js');
@ -100,4 +101,12 @@ if (config.dropbox) {
clientSecret: config.dropbox.clientSecret,
callbackURL: config.serverurl + '/auth/dropbox/callback'
}, callback));
}
//google
if (config.google) {
passport.use(new GoogleStrategy({
clientID: config.google.clientID,
clientSecret: config.google.clientSecret,
callbackURL: config.serverurl + '/auth/google/callback'
}, callback));
}