From 27482a84d5b3e3eee50fbaf29bde7510a197126e Mon Sep 17 00:00:00 2001 From: Loto-Kenneth <116004412+Loto-Kenneth@users.noreply.github.com> Date: Thu, 2 Jul 2026 00:20:17 +0800 Subject: [PATCH] fix: add @AllowAnonymous to root endpoint alongside @Public and @SkipArcjet - add @AllowAnonymous from @thallesp/nestjs-better-auth to root get handler - both @Public and @AllowAnonymous are required since two independent global guards run: our AuthGuard reads @Public, better auth's guard reads @AllowAnonymous --- src/app.controller.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/app.controller.ts b/src/app.controller.ts index 7994e9f..c205c39 100644 --- a/src/app.controller.ts +++ b/src/app.controller.ts @@ -1,4 +1,5 @@ import { Controller, Get } from "@nestjs/common"; +import { AllowAnonymous } from "@thallesp/nestjs-better-auth"; import { Public } from "./common/decorators/public.decorator.js"; import { SkipArcjet } from "./common/guards/arcjet-optional.guard.js"; @@ -6,6 +7,7 @@ import { SkipArcjet } from "./common/guards/arcjet-optional.guard.js"; export class AppController { @Get() @Public() + @AllowAnonymous() @SkipArcjet() getRoot() { return {