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

Check the cookies #19

Open
shahenazmonia opened this issue Aug 1, 2019 · 1 comment
Open

Check the cookies #19

shahenazmonia opened this issue Aug 1, 2019 · 1 comment

Comments

@shahenazmonia
Copy link

Why did you pass a file as a parameter since you can check the cookies as a first step and handle the page depend on the result like:

if(req.headers.cookie === undefined){
// handle the login/signup page
}else{
// get the cookies values and handle the home page
}

let filePath = path.join(__dirname, '..', '..', 'public', `${page}.html`);
if (page === 'profile') {

@shahenazmonia
Copy link
Author

Also, how did you check the cookies and user verify while you didn't set the cookies in your code!

if (cookie.parse(request.headers.cookie).loggedIn === 'true' && jwt) {

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