Open Rakshak1344 opened 4 years ago
here is the strategy used
//GOOGLE PLUS STRATEGY const GooglePlusTokenStrategy = require('passport-google-plus-token').Strategy //local-imports const { JWT_SECRET, GOOGLE_CLIENT_SECRET, GOOGLE_CLIENT_ID } = require('./config/index') passport.use('googleToken',new GooglePlusTokenStrategy({ clientID: GOOGLE_CLIENT_ID, clientSecret: GOOGLE_CLIENT_SECRET, authorizationURL: 'https://accounts.google.com/o/oauth2/auth', tokenURL: 'https://accounts.google.com/o/oauth2/token', }, function (req, accessToken, refreshToken, profile, next) { console.log('accessToken', accessToken) console.log('refreshToken', refreshToken) console.log('profile', profile) }));
here is my route file
const passport = require('passport') require('../passport') router.route('/oauth/google') .post(passport.authenticate('googleToken', { session: false })) module.exports = router
If I am not wrong, I think It is the issue with URL
authorizationURL: 'https://accounts.google.com/o/oauth2/v2/auth', tokenURL: 'https://accounts.google.com/o/oauth2/v2/token',
If I don't provide the above URL, I am getting an error
TypeError: OAuth2Strategy requires a authorizationURL option TypeError: OAuth2Strategy requires a tokenURL option
please help me out with this issue.
@Rakshak1344 your code is totally differs from what we are saying in documentation - https://github.com/ghaiklor/passport-google-plus-token#usage
here is the strategy used
here is my route file
If I am not wrong, I think It is the issue with URL
If I don't provide the above URL, I am getting an error
please help me out with this issue.