GoogleOauth2.0 First implementation

First try for GoogleOauth2.0
This commit is contained in:
Georg Reisinger
2018-10-26 14:02:15 +02:00
parent 216a04e233
commit b171f1646c
1880 changed files with 912953 additions and 7 deletions

View File

@ -0,0 +1,23 @@
const GoogleStrategy = require('passport-google-oauth').OAuth2Strategy;
module.exports = (passport) => {
passport.serializeUser((user, done) => {
done(null, user);
});
passport.deserializeUser((user, done) => {
done(null, user);
});
passport.use(new GoogleStrategy({
clientID: '987329071574-imvtfil34qrnlgouc0njo62aq4md5g1e.apps.googleusercontent.com',
clientSecret: 'xABbcOGWgLCp6X0P4BTjZNYb',
callbackURL: 'http://localhost:7000/auth/google/callback'
},
(token, refreshToken, profile, done) => {
return done(null, {
profile: profile,
token: token
});
}));
};