18 lines
648 B
JavaScript
18 lines
648 B
JavaScript
|
// noinspection SpellCheckingInspection
|
||
|
|
||
|
import express from 'express'
|
||
|
const router = express.Router()
|
||
|
import { register, login, getMe, forgotPassword, resetPassword, updateDetails, updatePassword, logout } from '../controllers/auth.js'
|
||
|
import { protect } from '../middleware/auth.js'
|
||
|
|
||
|
router.post('/register', register)
|
||
|
router.post('/login', login)
|
||
|
router.get('/logout', logout)
|
||
|
router.get('/me', protect, getMe)
|
||
|
router.put('/updatedetails', protect, updateDetails)
|
||
|
router.post('/forgotpassword', forgotPassword)
|
||
|
router.put('/resetpassword/:resettoken', resetPassword)
|
||
|
router.put('/updatepassword', protect, updatePassword)
|
||
|
|
||
|
export default router
|