multy-stub/server/routers/old/car-wash/auth/login/index.js

17 lines
492 B
JavaScript
Raw Normal View History

2023-08-01 13:14:02 +03:00
// eslint-disable-next-line new-cap
const router = require('express').Router()
router.post('/postAuthorization', (req, res) => {
if (req?.session?.[req.body.login]?.login) {
const { login } = req.session[req.body.login]
const { pass } = req.session[req.body.login]
if (login === req.body.login && pass === req.body.pass) {
return res.send(req.session[req.body.login])
}
}
res.send(require('./error.json'))
})
module.exports = router