From 28e109dbdd1e2cec20e84e2fb1d0cb5ac53d8cc4 Mon Sep 17 00:00:00 2001 From: Saiful Alom Date: Wed, 17 Jun 2026 11:50:49 +0600 Subject: [PATCH] fix(auth): pass raw Astro action reference to fix production payload extraction - Remove manual wrapper function and directly pass `actions.login` reference to `useAction` - Fix type-mapping mismatch that caused `onSuccess` data serialization to fail on the edge - Strip redundant error-mapping layer to match Astro's native payload structure --- src/modules/auth/auth.hooks.ts | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/modules/auth/auth.hooks.ts b/src/modules/auth/auth.hooks.ts index 3d2688c..868d1f3 100644 --- a/src/modules/auth/auth.hooks.ts +++ b/src/modules/auth/auth.hooks.ts @@ -15,14 +15,7 @@ export default function useLogIn() { // Setup the action runner using your custom hook const { execute, isLoading } = useAction( - async (data: LoginInput) => { - const result = await actions.login(data); - - return { - data: result.data, - error: result.error ? { message: result.error.message } : null, - }; - }, + actions.login, { loadingMessage: "Logging you in...", successMessage: "Login successful! Redirecting...",