Skip to content

Instantly share code, notes, and snippets.

const mongoose = require('mongoose');
const fauilureSchema = new mongoose.Schema({
roomNumber: {
type: String,
required: true
},
building: {
type: String,
required: true
const mongoose = require('mongoose');
const fauilureSchema = new mongoose.Schema({
roomNumber: {
type: String,
required: true
},
building: {
type: String,
required: true
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);