This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mongoose = require('mongoose'); | |
const fauilureSchema = new mongoose.Schema({ | |
roomNumber: { | |
type: String, | |
required: true | |
}, | |
building: { | |
type: String, | |
required: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mongoose = require('mongoose'); | |
const fauilureSchema = new mongoose.Schema({ | |
roomNumber: { | |
type: String, | |
required: true | |
}, | |
building: { | |
type: String, | |
required: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |