ananay / passport-apple

Passport strategy for Sign in with Apple
https://passport-apple.ananay.dev
142 stars 49 forks source link

TypeError: AppleStrategy is not a constructor #6

Closed geekpulp closed 4 years ago

geekpulp commented 4 years ago

As per the conversation on twitter. I'm getting an error when I launch my app:

passport.use( new AppleStrategy( { ^ TypeError: AppleStrategy is not a constructor

geekpulp commented 4 years ago

I seem to have worked around this. This error only presents when I have .strategy on the end of it.

Here's an example of work vs not working.

Working LocalStrategy = require( "passport-local" ).strategy, FacebookStrategy = require( 'passport-facebook' ).strategy, AppleStrategy = require( 'passport-apple' ),

Not working LocalStrategy = require( "passport-local" ).strategy, FacebookStrategy = require( 'passport-facebook' ).strategy, AppleStrategy = require( 'passport-apple' ).strategy,

ananay commented 4 years ago

Hi @geekpulp, thanks for sharing! This is already documented in the README.md file and also used in the example repository below: https://github.com/ananay/passport-apple-example