Let admins skip SMS on user, class, and invoice actions, and let users change their own password with the current one.
16 lines
591 B
JavaScript
16 lines
591 B
JavaScript
// /components/auth/authRoutes.js
|
|
|
|
const express = require('express');
|
|
const authController = require('./authController');
|
|
const { validateLogin, validateRefresh } = require('./authValidator');
|
|
const authMiddleware = require('../../middlewares/authMiddleware');
|
|
|
|
const router = express.Router();
|
|
|
|
router.post('/login', validateLogin, authController.login);
|
|
router.post('/refresh', validateRefresh, authController.refresh);
|
|
router.post('/logout', authMiddleware, authController.logout);
|
|
router.put('/change-password', authMiddleware, authController.changePassword);
|
|
|
|
module.exports = router;
|