multy-stub/server/routers/old/car-wash/auth/login/index.js
Primakov Alexandr Alexandrovich 4b0d9b4dbc mongoose + tests
2024-10-16 11:06:23 +03:00

17 lines
492 B
JavaScript

// 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