Hi, the cookies are being blocked on a different domain then the backend. The domain is .vercel.app...
e
Hi, the cookies are being blocked on a different domain then the backend. The domain is .vercel.app (a public domain?) We added this to the init function from supertokens
Copy code
js
  recipeList: [
    ThirdPartyEmailPassword.init(),
    Session.init({
      sessionTokenBackendDomain: getCookiesDomain(),
edit: we have this issue since updating supertokens-web-js to 0.5
r
hey @edwinn1337 `.vercel.app`is a public suffix domain and can't be used to share cookies.
e
ah right! i'll move our staging env to our domain then. thanks!
since updating we get this error on our serverless functions Did you forget to call the SuperTokens.init function? at SuperTokens.getInstanceOrThrowError (/var/task/node_modules/supertokens-node/lib/build/supertokens.js:372:15) at SuperTokensWrapper.getAllCORSHeaders (/var/task/node_modules/supertokens-node/lib/build/index.js:28:38) at authCors (/var/task/apps/dashboard-web/.next/server/pages/api/actions/getCloudinaryStandardImages.js:203:72) we use allowedHeaders: [ 'content-type', ...supertokens.getAllCORSHeaders(), getAllCorsHEaders for our cors setup. In previous versions we didnt need to init supertokens, is it correct that we have to now? if we use the corsheaders?
r
there hasn't been any change related to that
so not sure why this error pops up now
e
its weird,
Copy code
js
Error: Initialisation not done. Did you forget to call the SuperTokens.init function?
    at SuperTokens.getInstanceOrThrowError (/var/task/node_modules/supertokens-node/lib/build/supertokens.js:372:15)
    at SuperTokensWrapper.getAllCORSHeaders (/var/task/node_modules/supertokens-node/lib/build/index.js:28:38)
    at authCors (/var/task/apps/dashboard-web/.next/server/pages/api/actions/getCloudinaryStandardImages.js:203:72)
    at getCloudinaryStandardImages (/var/task/apps/dashboard-web/.next/server/pages/api/actions/getCloudinaryStandardImages.js:87:87)
    at /var/task/apps/dashboard-web/.next/server/chunks/4148.js:46:16
    at /var/task/apps/dashboard-web/.next/server/chunks/7284.js:39:16
    at /var/task/node_modules/@sentry/nextjs/cjs/server/wrapApiHandlerWithSentry.js:136:56
    at /var/task/node_modules/@sentry/node/cjs/async/hooks.js:38:14
    at AsyncLocalStorage.run (node:async_hooks:338:14)
    at Object.runWithAsyncContext (/var/task/node_modules/@sentry/node/cjs/async/hooks.js:37:25)
Error: Initialisation not done. Did you forget to call the SuperTokens.init function?
    at SuperTokens.getInstanceOrThrowError (/var/task/node_modules/supertokens-node/lib/build/supertokens.js:372:15)
    at SuperTokensWrapper.getAllCORSHeaders (/var/task/node_modules/supertokens-node/lib/build/index.js:28:38)
    at authCors (/var/task/apps/dashboard-web/.next/server/pages/api/actions/getCloudinaryStandardImages.js:203:72)
    at getCloudinaryStandardImages (/var/task/apps/dashboard-web/.next/server/pages/api/actions/getCloudinaryStandardImages.js:87:87)
r
not sure why this would happen - other than guessing that well, init was not called
e
yeah, could add the init line but its weird that the error popups now
r
yea.. for sure
e
since we use this cors function for all our serverless functions
😉
r
yeaaa
6 Views