im trying to get the logged in users email on the backend:
const ThirdParty = require("supertokens-node/recipe/thirdparty");
async function generateNewInvoice(req, res, next) {
const userId = session.userId;
let userInfo = await ThirdParty.getUserById(userId);
But it dies at the ThirdParty.getByUserId() method:
Uncaught Error Error: Initialisation not done. Did you forget to call the SuperTokens.init function.
Im following this guide basically exactly. What am I doing wrong?
https://supertokens.com/docs/thirdparty/common-customizations/get-user-info#using-getuserbyid
r
rp_st
06/23/2023, 6:07 PM
Hey. Which recipe have you initialised on the backend?
b
bitcoinrippin
06/24/2023, 2:06 AM
email password
r
rp_st
06/24/2023, 3:55 AM
Right. So you shouldn’t import from thirdparty recipe.
b
bitcoinrippin
06/24/2023, 11:59 AM
Ohhhhhhhhhhhhhhhh. Thanks. Makes sense in hind sight
bitcoinrippin
06/24/2023, 12:00 PM
I cant tell you how much a appreciate the support. There is nothing worse than having no one to talk to when working on a project.
SuperTokens is an open source authentication solution offering features like: Different types of login: Email / password, Passwordless (OTP or Magic link based).