Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with URL #194

Open
Rakshak1344 opened this issue Mar 17, 2020 · 1 comment
Open

Issue with URL #194

Rakshak1344 opened this issue Mar 17, 2020 · 1 comment

Comments

@Rakshak1344
Copy link

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.

@ghaiklor
Copy link
Owner

@Rakshak1344 your code is totally differs from what we are saying in documentation - https://github.com/ghaiklor/passport-google-plus-token#usage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants