Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authintication #40

Open
NouraldinS opened this issue May 6, 2018 · 0 comments
Open

Authintication #40

NouraldinS opened this issue May 6, 2018 · 0 comments

Comments

@NouraldinS
Copy link

const jwt = require('jsonwebtoken');
const {
parse
} = require('cookie');
exports.get = (req, res) => {
const {
accessToken
} = parse(req.headers.cookie);
jwt.verify(accessToken, process.env.JWT_KEY, (err, decoded) => {

What you're doing here is almost correct, but the authentication checking should be done to each and every request the user sends, not only the user page because later on, you had to put the same code in home_page.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant