From 9404422a39ec8e2e44eec8a1cb08979f762b9095 Mon Sep 17 00:00:00 2001 From: Santiago Mera Date: Fri, 18 Oct 2024 16:47:41 -0300 Subject: [PATCH] auth: allow basePath configuration (#1007) --- sdk/js/src/auth/handler.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sdk/js/src/auth/handler.ts b/sdk/js/src/auth/handler.ts index ae7d788b6..dd056ee0f 100644 --- a/sdk/js/src/auth/handler.ts +++ b/sdk/js/src/auth/handler.ts @@ -65,6 +65,7 @@ export function AuthHandler< >; }[keyof Providers], >(input: { + basePath?: string; stream?: boolean; session?: Sessions; providers: Providers; @@ -104,7 +105,7 @@ export function AuthHandler< }; }; }) { - const app = new Hono(); + const app = input.basePath ? new Hono().basePath(input.basePath) : new Hono(); if (!input.callbacks.auth.error) { input.callbacks.auth.error = async (err) => {