Closed cjs840312 closed 6 years ago
Hello, @cjs840312!
Did you found solution?
Not yet, let me first check it out if it is really filemanager's problem. Sorry for bothering. I'll update if I found the root cause
It seem's like passport.js doesn't work well with axios
I solve it in a dirty way. I rewrite the authorize part and things fixed
authRouter.use(
["/api"],
(req, res, next) => {
if (req.session.passport) {
next();
} else {
res.redirect("/");
}
},
);
Hi, I'm trying to protect the API by Passport.js I use the localStrategy with sessions and the code works well when no authorize function applied but it can't fatch the data if I add the authorize function ( last line in server.js) Authorization works well for other url so it may not be passport's problem.
in client
in server.js