passport-magic-login
passport-magic-login copied to clipboard
TypeError: MagicLoginStrategy is not a constructor
Hello,
While literally copy pasting your code, I get a error message that the MagicLoginStrategy is not a constructor. Why is this happening?
const magicLogin = new MagicLoginStrategy({
....
})
// Add the passport-magic-login strategy to Passport
// passport.use(magicLogin)
Thanks!
Same here, were you able to sort this?
Ok it was const MagicLoginStrategy = require('passport-magic-login').default
is there a solution to this without using require?
If you're using ESM, you can import it like this:
import _MagicLoginStrategy from 'passport-magic-login';
const MagicLoginStrategy = _MagicLoginStrategy.default;
const magicLogin = new MagicLoginStrategy({
...
});