Skip to content
This repository has been archived by the owner on Mar 29, 2019. It is now read-only.

TokenStrategy is not a constructor #17

Open
bolutife-lawrence opened this issue Dec 15, 2016 · 3 comments
Open

TokenStrategy is not a constructor #17

bolutife-lawrence opened this issue Dec 15, 2016 · 3 comments

Comments

@bolutife-lawrence
Copy link

Looks like passport-google-token is having some trouble registering.

 express:router:route delete /auth/google/:__feathersId +0ms
  express:router:layer new / +0ms
  express:router:route delete /auth/google/:__feathersId +0ms
  express:router:layer new / +0ms
  express:router:route delete /auth/google/:__feathersId +0ms
  express:router:layer new / +0ms
  feathers-authentication:oauth2 registering passport-google OAuth2 strategy +1ms
  feathers-authentication:oauth2 registering passport-google-token OAuth2 strategy +1ms
/Users/lawrencebolutife/Documents/kunibooks_api/node_modules/feathers-authentication/lib/services/oauth2.js:49
      _passport2.default.use(new TokenStrategy(options, service.oauthCallback.bind(service)));
                             ^

TypeError: TokenStrategy is not a constructor
@MaxCaribe
Copy link

I had the same problem and found solution to import strategy in such way:
var GoogleTokenStrategy = require('passport-google-token').Strategy

@bolutife-lawrence
Copy link
Author

bolutife-lawrence commented Mar 16, 2017

That's the exact way I had it imported @MaxCaribe. The problem was leaving in the dummy text Place you client secret here ... or something like that, in the app's config for authentication. Using an empty string instead, solved the problem.

@lakmalniranga
Copy link

You can use es6 syntax like
import { Strategy as GoogleTokenStrategy } from 'passport-google-token'

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

No branches or pull requests

3 participants