import { auth } from "@haushaltsApp/auth";
import { Hono } from "hono";
import { authLimiter } from "../middleware/rate-limit.middleware";

export const authRoutes = new Hono();

// Rate-limit sign-in endpoints to prevent brute-force attacks
authRoutes.post("/sign-in/*", authLimiter);
authRoutes.post("/sign-up/*", authLimiter);

authRoutes.on(["GET", "POST"], "/*", (c) => auth.handler(c.req.raw));
