import express from 'express'
import authMiddleware from '../middleware/authMiddleware.js'
import { register, login, forgotPassword, resetPassword, changePassword, refreshAccessToken, logout, deleteAccount } from '../controller/authController.js'
const authRoutes = express.Router()

// register
authRoutes.post('/register', register)
// login
authRoutes.post('/login', login)

// refresh access token
authRoutes.post('/refresh-token', refreshAccessToken)

// logout
authRoutes.post('/logout', logout)

authRoutes.post('/change-password', authMiddleware, changePassword)
authRoutes.post('/reset-password', authMiddleware, resetPassword)
authRoutes.post('/forgot-password', forgotPassword)
authRoutes.delete('/delete-account', authMiddleware, deleteAccount)

export default authRoutes