diff --git a/package.json b/package.json index 738849c1..d4ace093 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "server": "node server/server.mjs", "start": "astro dev", "start:local": "cross-env PUBLIC_API_URL=http://127.0.0.1:8080 astro dev", + "start:production": "cross-env PUBLIC_API_URL=https://v2.discours.io astro dev", "start:staging": "cross-env PUBLIC_API_URL=https://testapi.discours.io astro dev", "typecheck": "astro check && tsc --noEmit", "typecheck:watch": "tsc --noEmit --watch", diff --git a/src/context/session.tsx b/src/context/session.tsx index 211fe843..0c1751aa 100644 --- a/src/context/session.tsx +++ b/src/context/session.tsx @@ -33,12 +33,13 @@ export const SessionProvider = (props: { children: JSX.Element }) => { return null } setToken(authResult.token) - setIsSessionLoaded(true) return authResult } catch (error) { console.error('getSession error:', error) resetToken() return null + } finally { + setIsSessionLoaded(true) } }