|
| 1 | + |
1 | 2 | import passport from 'passport'; |
2 | 3 | import GoogleStrategy from 'passport-google-oauth20'; |
3 | 4 | import { User } from '../models/user-models.js'; |
4 | 5 |
|
5 | | -import { keys } from './keys.js'; |
| 6 | +import { GoogleclientID, GoogleclientSecret } from '../loadSecrets.js'; |
6 | 7 |
|
7 | | -// const keys = require ('./keys'); |
8 | | -import { GoogleclientID, GoogleclientSecret } from './../index.js'; |
| 8 | +// const logging = console.log(GoogleclientID + ' --- ' + GoogleclientSecret); |
9 | 9 |
|
10 | 10 | // serialize user structure in the mongodb |
11 | 11 | const serialize = passport.serializeUser((user, done) => { |
|
34 | 34 | const googleStrategy = passport.use(new GoogleStrategy({ |
35 | 35 | // options for google strategy |
36 | 36 | callbackURL: '/auth/google/redirect', |
37 | | - clientID: keys.google.clientID, //GoogleclientID, |
38 | | - clientSecret: keys.google.clientSecret //GoogleclientSecret |
| 37 | + // clientID: keys.google.clientID, |
| 38 | + // clientSecret: keys.google.clientSecret |
| 39 | + clientID: GoogleclientID, |
| 40 | + clientSecret: GoogleclientSecret |
| 41 | + |
39 | 42 | }, (accessToken, refreshToken, profile, done) => { |
40 | 43 | // passport callback function |
41 | 44 | // console.log('accessToken: ' + accessToken); |
|
0 commit comments