flame/routes/auth.js

12 lines
352 B
JavaScript
Raw Normal View History

2021-11-10 18:14:22 +03:00
const express = require('express');
const router = express.Router();
const { login, validate } = require('../controllers/auth');
2021-11-10 18:14:22 +03:00
const requireBody = require('../middleware/requireBody');
router.route('/').post(requireBody(['password', 'duration']), login);
router.route('/validate').post(requireBody(['token']), validate);
2021-11-10 18:14:22 +03:00
module.exports = router;