Skip to content

Instantly share code, notes, and snippets.

@laniltee
Created October 26, 2018 15:10
Show Gist options
  • Save laniltee/ad4a6f25e56106199a272c0e7f3e87ed to your computer and use it in GitHub Desktop.
Save laniltee/ad4a6f25e56106199a272c0e7f3e87ed to your computer and use it in GitHub Desktop.
Login page load
// Login Page Load
app.get('/', (req, res) => {
const sessionID = req.cookies['session-id'];
if (sessionID && SESSION_IDS[sessionID]) {
console.log("Login: Valid Session Found !");
res.sendFile('views/form.html', {root: __dirname});
} else {
console.log("Login: No Valid Session Found !");
res.sendFile('views/login.html', {root: __dirname});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment