15 lines
534 B
JavaScript
15 lines
534 B
JavaScript
const express = require('express');
|
|
const router = express.Router();
|
|
const { handlerLogin, setHandlerPassword, updateHandlerSelf, getHandlerSelf } = require('../controllers/handlerController');
|
|
const { authenticateHandler } = require('../middleware/handlerAuth');
|
|
|
|
// Public
|
|
router.post('/login', handlerLogin);
|
|
router.post('/set-password', setHandlerPassword);
|
|
|
|
// Authenticated handler only
|
|
router.get('/me', authenticateHandler, getHandlerSelf);
|
|
router.put('/me', authenticateHandler, updateHandlerSelf);
|
|
|
|
module.exports = router;
|