/**
 * /admin/auth/* (mounted at /admin in src/routes/index.ts — PLANNING.md §4b).
 * All but /me are unauthenticated entry points; every other /admin/* route
 * (steps 5–7) sits behind `authenticate`.
 */
import { Router } from 'express';
import { asyncHandler } from '../../lib/asyncHandler';
import { authenticate } from '../../middleware/authenticate';
import * as auth from './auth.controller';

export const authRouter = Router();

authRouter.post('/auth/login', asyncHandler(auth.login));
authRouter.post('/auth/refresh', asyncHandler(auth.refresh));
authRouter.post('/auth/logout', asyncHandler(auth.logout));
authRouter.post('/auth/forgot-password', asyncHandler(auth.forgotPassword));
authRouter.post('/auth/reset-password', asyncHandler(auth.resetPassword));
authRouter.get('/auth/me', authenticate, asyncHandler(auth.me));
