From 597e0d939081513d0948577cfcdda5eea2d5bfde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Schober?= Date: Fri, 20 Mar 2026 16:31:27 +0100 Subject: [PATCH] fix: async SecureStore token read + prod env fallback Co-Authored-By: Claude Sonnet 4.6 --- apps/native/src/lib/auth-client.ts | 2 +- packages/env/src/native.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/native/src/lib/auth-client.ts b/apps/native/src/lib/auth-client.ts index eb792b5..28e43a4 100644 --- a/apps/native/src/lib/auth-client.ts +++ b/apps/native/src/lib/auth-client.ts @@ -18,7 +18,7 @@ export const authClient = createAuthClient({ }, auth: { type: "Bearer", - token: () => SecureStore.getItem(TOKEN_KEY) ?? "", + token: async () => (await SecureStore.getItemAsync(TOKEN_KEY)) ?? "", }, }, plugins: [ diff --git a/packages/env/src/native.ts b/packages/env/src/native.ts index 0799adf..395b869 100644 --- a/packages/env/src/native.ts +++ b/packages/env/src/native.ts @@ -6,6 +6,8 @@ export const env = createEnv({ client: { EXPO_PUBLIC_SERVER_URL: z.url(), }, - runtimeEnv: process.env, + runtimeEnv: { + EXPO_PUBLIC_SERVER_URL: process.env.EXPO_PUBLIC_SERVER_URL ?? "https://api.app-forge.dev", + }, emptyStringAsUndefined: true, });