I'm trying to migrate a custom based controller API based on express to TSOA framework. I was using passport to handle authentication before.
How can I use it with TSOA? It seems to be ignored.
I'm trying to migrate a custom based controller API based on express to TSOA framework. I was using passport to handle authentication before.
How can I use it with TSOA? It seems to be ignored.
I think that you need just to add app.use(passport.authenticate('jwt'));
above RegisterRoutes(app);
in your (propbaly) server.ts
file.
Like this:
// ...
// passport.use('jwt',new JWTStrategy({<your_data_here>}));
// passport.initialize();
app.use(passport.authenticate('jwt'));
RegisterRoutes(app);
// ...
// const httpServer = createServer(app);
// httpServer.listen(82811, () => {
// console.log(`Server is running at http://localhost:82811`);
// });