Merge pull request #76 from Discours/session-hotfix
session context hotfix
This commit is contained in:
commit
e58285019b
|
@ -26,6 +26,7 @@
|
||||||
"server": "node server/server.mjs",
|
"server": "node server/server.mjs",
|
||||||
"start": "astro dev",
|
"start": "astro dev",
|
||||||
"start:local": "cross-env PUBLIC_API_URL=http://127.0.0.1:8080 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",
|
"start:staging": "cross-env PUBLIC_API_URL=https://testapi.discours.io astro dev",
|
||||||
"typecheck": "astro check && tsc --noEmit",
|
"typecheck": "astro check && tsc --noEmit",
|
||||||
"typecheck:watch": "tsc --noEmit --watch",
|
"typecheck:watch": "tsc --noEmit --watch",
|
||||||
|
|
|
@ -33,12 +33,13 @@ export const SessionProvider = (props: { children: JSX.Element }) => {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
setToken(authResult.token)
|
setToken(authResult.token)
|
||||||
setIsSessionLoaded(true)
|
|
||||||
return authResult
|
return authResult
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('getSession error:', error)
|
console.error('getSession error:', error)
|
||||||
resetToken()
|
resetToken()
|
||||||
return null
|
return null
|
||||||
|
} finally {
|
||||||
|
setIsSessionLoaded(true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user