Skip to content

Commit 1fad149

Browse files
committed
Move dotenv configuration to separate module and import it in before application initialization occurred.
1 parent 043e656 commit 1fad149

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

config/passport-setup.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1+
12
import passport from 'passport';
23
import GoogleStrategy from 'passport-google-oauth20';
34
import { User } from '../models/user-models.js';
45

5-
import { keys } from './keys.js';
6+
import { GoogleclientID, GoogleclientSecret } from '../loadSecrets.js';
67

7-
// const keys = require ('./keys');
8-
import { GoogleclientID, GoogleclientSecret } from './../index.js';
8+
// const logging = console.log(GoogleclientID + ' --- ' + GoogleclientSecret);
99

1010
// serialize user structure in the mongodb
1111
const serialize = passport.serializeUser((user, done) => {
@@ -34,8 +34,11 @@ try {
3434
const googleStrategy = passport.use(new GoogleStrategy({
3535
// options for google strategy
3636
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+
3942
}, (accessToken, refreshToken, profile, done) => {
4043
// passport callback function
4144
// console.log('accessToken: ' + accessToken);

0 commit comments

Comments
 (0)