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

Ensure sessions are working #13

Open
martingaston opened this issue Aug 24, 2018 · 0 comments
Open

Ensure sessions are working #13

martingaston opened this issue Aug 24, 2018 · 0 comments

Comments

@martingaston
Copy link
Collaborator

Need to test and ensure our session cookies are working correctly - here's the relevant code in our controllers at present.

exports.post = (req, res) => {
const { username, password } = req.body;
queries.checkAuth(username, (err, result) => {
const hashPassword = result;
if (bcrypt.compareSync(password, hashPassword)) {
req.session.user = JSON.stringify({ username, hashPassword });
res.redirect("/login");
} else {
console.log("Bad login");
res.redirect("/login");
}
});

Only our profile route is currently protected

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

No branches or pull requests

1 participant