Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //All the necessary imports
- const googleConfig = new GoogleStrategy(
- {
- clientID: process.env.GOOGLE_CLIENT_ID,
- clientSecret: process.env.GOOGLE_CLIENT_SECRET,
- callbackURL: '/auth/google/callback'
- },
- (accessToken, refreshToken, profile, done) => {
- //set the profile to req object in the form of req.object
- }
- );
- passport.use(googleConfig);
- app.use('/auth', passport.authenticate('google', {
- scope: ['profile']
- })); // Here I want to put anoter middleware that will take care of saving
- the data in the database but I do not know how to access the data
- app.use('/auth/google/callback', passport.authenticate('google'),
- (req, res) => {
- res.send('You are loggedIn');
- });
Add Comment
Please, Sign In to add comment