Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
app.get('/', (req, res) => {
// When logged in user object is attached to the request
if (!req.user) {
res.send(`Hello ${req.user.emails[0].address}`);
app.get('/login', (req, res) => {
res.send(`<form action="/login" method="post">
<input type="text" name="username"/>
<input type="password" name="password"/>
<input type="submit" value="Log In"/>
});'/login', passport.authenticate('local', {
successRedirect: '/',
failureRedirect: '/error',
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment