Open santekotturi opened 6 years ago
I am having exactly the same issue here ...
@skotturi Could you try to import configuration file? resolve by add one line below
# controller/user.ts
......
import "../config/passport";
Had the same problem. Turns out that importing passport config without actually using it in app.ts means the same as not importing it.
replacing import * as passportConfig from "./config/passport";
with import "./config/passport";
solves the issue.
yo tengo este problema y no se como solucionarlo , alguien me puede ayudar?
I was having the same problem, i don't know if it's something related to you guys, but i was importing passport from the actual passport module, instead of the passport.js i had created, so: instead of this: import passport from 'passport.js' i used this: import passport from './passport.js'
When running the app as cloned, I got
Error: Unknown authentication strategy "local"
fromcontrollers/user.ts line 41:
passport.authenticate("local", ...
I remedied it by importing the configured passport instance from
config/passport.ts
.Added
export default passport;
to the end of config/passport.ts so that I could import it in controllers/user.tsI'm curious, I presume the error is because I'm doing something wrong, just not sure what ¯_(ツ)_/¯
[EDIT] also had to add
app.use(passport.initialize());
toapp.ts
🤔