Some checks failed
Sync dev → Gitea / Mirror dev to Gitea (push) Has been cancelled
- Added a comment line to main.ts for deployment verification purposes
17 lines
498 B
TypeScript
17 lines
498 B
TypeScript
import { All, Controller, Req, Res } from "@nestjs/common";
|
|
import { toNodeHandler } from "better-auth/node";
|
|
import { Request, Response } from "express";
|
|
import { Public } from "../common/decorators/public.decorator";
|
|
import { getAuth } from "./auth";
|
|
|
|
@Controller("auth")
|
|
export class AuthController {
|
|
@Public()
|
|
@All("**")
|
|
async handleAuth(@Req() req: Request, @Res() res: Response) {
|
|
const auth = getAuth();
|
|
const handler = toNodeHandler(auth);
|
|
return handler(req, res);
|
|
}
|
|
}
|