16 lines
562 B
JavaScript
16 lines
562 B
JavaScript
const express = require('express');
|
|
const router = express.Router();
|
|
const authController = require('../controllers/authController');
|
|
const { authenticate } = require('../middleware/auth');
|
|
|
|
// Public routes
|
|
router.post('/register', authController.register);
|
|
router.post('/login', authController.login);
|
|
|
|
// Protected routes
|
|
router.get('/profile', authenticate, authController.getProfile);
|
|
router.put('/profile', authenticate, authController.updateProfile);
|
|
router.post('/change-password', authenticate, authController.changePassword);
|
|
|
|
module.exports = router;
|