oldhack1364
11/25/2022, 2:34 PMError: Initialisation not done. Did you forget to call the SuperTokens.init function?
at Function.getInstanceOrThrowError (/app/node_modules/supertokens-node/lib/build/recipe/emailpassword/recipe.js:199:15)
at /app/node_modules/supertokens-node/lib/build/recipe/dashboard/api/userdetails/userPut.js:76:18
at Generator.next (<anonymous>)
at /app/node_modules/supertokens-node/lib/build/recipe/dashboard/api/userdetails/userPut.js:30:75
at new Promise (<anonymous>)
But when I refresh the dashboard, the meta has actually savedoldhack1364
11/25/2022, 2:35 PMsupertokens.init(backendConfig());
export default async function superTokens(
req: NextApiRequest & Request,
res: NextApiResponse & Response,
) {
// NOTE: We need CORS only if we are querying the APIs from a different origin
await NextCors(req, res, {
methods: ['GET', 'HEAD', 'PUT', 'PATCH', 'POST', 'DELETE'],
origin: process.env.NEXT_PUBLIC_APP_DOMAIN,
credentials: true,
allowedHeaders: ['content-type', ...supertokens.getAllCORSHeaders()],
});
await superTokensNextWrapper(
async (next) => {
// This is needed for production deployments with Vercel
res.setHeader(
'Cache-Control',
'no-cache, no-store, max-age=0, must-revalidate',
);
await middleware()(req, res, next);
},
req,
res,
);
if (!res.writableEnded) {
res.status(404).send('Not found');
}
}
oldhack1364
11/25/2022, 2:37 PMrp_st
11/25/2022, 2:37 PMnkshah2
11/25/2022, 2:46 PMnkshah2
11/25/2022, 2:46 PMoldhack1364
11/25/2022, 2:50 PMnkshah2
11/25/2022, 2:50 PMoldhack1364
11/25/2022, 2:51 PMnkshah2
11/25/2022, 2:52 PMoldhack1364
11/25/2022, 2:54 PMnkshah2
11/25/2022, 2:55 PMoldhack1364
11/25/2022, 2:55 PMconst recipeList = [
ThirdPartyEmailPassword.init({}),
EmailVerificationNode.init({ mode: 'REQUIRED' }),
SessionNode.init({ jwt: { enable: true } }),
UserMetadata.init(),
];
if (process.env.NEXT_SUPERTOKENS_DASHBOARD_KEY) {
console.log('adding supertokens dashboard recipe');
recipeList.push(
Dashboard.init({ apiKey: process.env.NEXT_SUPERTOKENS_DASHBOARD_KEY }),
);
} else {
console.log('skipping supertokens dashboard');
}
nkshah2
11/25/2022, 2:56 PMoldhack1364
11/25/2022, 2:58 PM{
"recipeId": "emailpassword",
"userId": "e7c863b4-ce35-4b20-924f-d34926f9cd72",
"phone": "",
"email": "****@gmail.com",
"firstName": "Foob",
"lastName": "Bam"
}
nkshah2
11/25/2022, 2:59 PMoldhack1364
11/25/2022, 3:00 PMError: Initialisation not done. Did you forget to call the SuperTokens.init function?
at Function.getInstanceOrThrowError (/app/node_modules/supertokens-node/lib/build/recipe/emailpassword/recipe.js:199:15)
at /app/node_modules/supertokens-node/lib/build/recipe/dashboard/api/userdetails/userPut.js:76:18
at Generator.next (<anonymous>)
at /app/node_modules/supertokens-node/lib/build/recipe/dashboard/api/userdetails/userPut.js:30:75
at new Promise (<anonymous>)
nkshah2
11/25/2022, 3:04 PMoldhack1364
11/25/2022, 3:18 PMnkshah2
11/25/2022, 3:19 PMrp_st
11/25/2022, 5:26 PMoldhack1364
11/25/2022, 5:26 PM