1const express = require('express')
2const router = express.Router()
3const passport = require('passport')
4const { index } = require('../controllers/login.controller').loginController
5
6router.get('/login', index)
7router.post(
8 '/login',
9 passport.authenticate('local', {
10 badRequestMessage: '<div class="alert alert-danger">User account is not exist</div>',
11 failureFlash: true,
12 successFlash: true,
13 failureRedirect: '/user/login',
14 successRedirect: '/'
15 })
16)
17
18module.exports = router
19