games-express-api/routes/auth.js

18 lines
648 B
JavaScript
Raw Normal View History

2024-09-12 15:48:27 -04:00
// 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