Skip to content

Instantly share code, notes, and snippets.

View failure.js
const mongoose = require('mongoose');
const fauilureSchema = new mongoose.Schema({
roomNumber: {
type: String,
required: true
},
building: {
type: String,
required: true
View gist:6e2647aab9ae50226657fd411a61a741
const mongoose = require('mongoose');
const fauilureSchema = new mongoose.Schema({
roomNumber: {
type: String,
required: true
},
building: {
type: String,
required: true
View gist:4a381b873ed666b2b8b146cb8d6613b5
const express = require('express');
const router = express.Router();
const passport = require('passport');
router.post(‘/login’, (req, res, next) => {
passport.authenticate(‘local’, {
successRedirect: ‘/’,
failureRedirect: ‘/users/login’,
failureFlash: true
})(req, res, next);