aquamarine2620
09/27/2023, 3:27 PMconsole.log('toto1')
const session = await Session.getSession(req, res)
const user = await EmailPassword.getUserById(session.getUserId())
console.log('toto2')
if (user === undefined) {
next(new Error('INTERNAL_AUTHENTICATION_ERROR'))
return
}
const { metadata } = await UserMetadata.getUserMetadata(user.id)
It fail after the second console.log and I think it's the UserMetadata that fails it.
The init looks like this:
recipeList: [
UserRoles.init(), // RBAC
Session.init({ cookieDomain: `.${process.env.CLUSTER_HOST ?? ''}` }), // initializes session features
UserMetadata.init()
]
Also when this occurs our pods logs this:
/app/node_modules/supertokens-node/lib/build/recipe/emailpassword/recipe.js:204
throw new Error("Initialisation not done. Did you forget to call the SuperTokens.init function?");
^
Error: Initialisation not done. Did you forget to call the SuperTokens.init function?
at Recipe.getInstanceOrThrowError (/app/node_modules/supertokens-node/lib/build/recipe/emailpassword/recipe.js:204:15)
at Object.getUserById (/app/node_modules/supertokens-node/lib/build/recipe/emailpassword/index.js:72:33)
at file:///app/dist/endpoints/save_shipping/post/controller.js:18:38
at Generator.next (<anonymous>)
at fulfilled (file:///app/dist/endpoints/save_shipping/post/controller.js:4:58)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
rp_st
09/27/2023, 3:41 PMaquamarine2620
09/27/2023, 4:45 PM