EdwinN1337
06/24/2022, 9:13 AM_app.tsx
(nextjs app)
js
if (typeof window !== 'undefined') {
supertokens.init({
...frontendConfig().appInfo,
})
}
In our Layout
component we initialize the user, by running a effect (which is client side) to getUser()
in our zustand storerp
06/24/2022, 9:14 AMEdwinN1337
06/24/2022, 9:15 AMimport { doesSessionExist } from 'supertokens-website'
rp
06/24/2022, 9:17 AMEdwinN1337
06/24/2022, 9:17 AMrp
06/24/2022, 9:18 AMimport SuperTokens from 'supertokens-website'
And then do:
SuperTokens.doesSessionExist()
InsteadEdwinN1337
06/24/2022, 9:21 AMrp
06/24/2022, 9:24 AMEdwinN1337
06/24/2022, 9:24 AMrp
06/24/2022, 9:24 AMEdwinN1337
06/24/2022, 9:28 AMrp
06/24/2022, 9:29 AMEdwinN1337
06/25/2022, 10:23 AMrp
06/25/2022, 10:23 AM