You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I created a login system for the site with Facebook via Passport. I keep the token on req.user and transfer it to the store through redux, and I keep it in
local storage.
I'm stuck in the testing phase whether or not the user is logged in while loading the app for the first time. If it comes from the server, the local storage. is not defined.
Another option is to save the token in req.user or req.session, but I can not do dispatch to action what routes.js file.
I created a login system for the site with Facebook via Passport. I keep the token on req.user and transfer it to the store through redux, and I keep it in
local storage.
I'm stuck in the testing phase whether or not the user is logged in while loading the app for the first time. If it comes from the server, the local storage. is not defined.
Another option is to save the token in req.user or req.session, but I can not do dispatch to action what routes.js file.
routes.js:
Actions.js:
server, checkAuth:
`export function checkAuth (req, res, next) {
if (req.user) {
return res.json({
message: '',
user: { ok: true, token: generateToken(req.user), user: req.user}
});
}
else {
return res.status(400).send({ msg: 'not authorization' });
}
}`
The text was updated successfully, but these errors were encountered: