We have Supertokens setup in staging & production. I'm trying to look up the user registration for s...
s
We have Supertokens setup in staging & production. I'm trying to look up the user registration for some users having issues with login to support the users. ------------------------------------------------- Issue 1: In Staging, we have access to the database. In Production, we don't have db access & the docs direct us to use the dashboard. I created a standalone script that does Dashboard.init() per the docs. When I navigate to https://nuwim68gx8.execute-api.us-west-2.amazonaws.com/auth/dashboard, I get a 403-Forbidden error. ----------------------------------------------------- Issue 2: When I try to look up a user calling: ThirdParty.getUserById(userId), I get an error: TypeError: Cannot read properties of undefined (reading 'init') at Object. (../../node_modules/.pnpm/supertokens-node@13.1.1/node_modules/supertokens-node/lib/build/recipe/emailverification/index.js:169:33) at Object. (../../node_modules/.pnpm/supertokens-node@13.1.1/node_modules/supertokens-node/lib/build/recipe/dashboard/api/userdetails/userEmailVerifyGet.js:42:45) -------------------------------------------------- Support appreciated. Our company also has paid support. Happy to ping paid support as well; in that case, what's the best way to get support.
r
hey @swami9046
the dashboard is exposed by the backend SDK
so navigate to /auth/dashboard
s
I see the apiDomain defined as: which I understand is the url provided by Supertokens. Is this defined wrong? (Sorry, picking up the code from a dev no longer with the company).
r
about the getUserById issuey, are you calling this in your backend API?
s
Yes
r
So https://nuwim68gx8.execute-api.us-west-2.amazonaws.com/ is your backend layer which integrates our backend SDK?
> Our company also has paid support Im not sure that's the case - which company are you from? You can DM me the name
s
Thanks for clarifying our status.
r
403 is a status code that's not returned from our backend SDK. So somewhere, your service is returning that. That's on you to figure out 🙂
About the
getUserById
function call, the error stack indicates the dashboard API is being called. So when you say
When I try to look up a user calling: ThirdParty.getUserById(userId),
, i don't quite understand how your calling the funciton is calling the dashboard API. Maybe clarify whats going on here.
s
A user is registered with us but is having issues logging in. I'm trying to look up the user's status, hence my attempt to use the production dashboard or lookup a user based off the id we used to register the user. I initialized Supertokens config with:
Copy code
supertokens.init({
    framework: "awsLambda" as TypeFramework,
    supertokens: {
      connectionURI,
      apiKey,
    },
    appInfo: {
      appName,
      apiDomain,
      websiteDomain,
      apiBasePath,
      apiGatewayPath: `/${apiGatewayPath}`,
    },
    recipeList: [Dashboard.init()],
  })
Called:
user = await ThirdParty.getUserById(userId)
Tried accessing the dashboared but not sure how to pass credentials to the dashboard. If it helps, this call on staging works for my code. I was able to verify this on the staging database to which we have direct access.
await deleteUserForId(userId)
Let me ask the question differently. Is there any documentation on how I can view existing users registered with Supertokens?
r
The recipe list must also have an auth recipe. For example, it must also have thirdparty.init if that’s the recipe you are using
s
I managed to get the user using the API getUsersNewestFirst.
r
that's not the best way of doing it.. you will have to loop through all the users.
s
True. I couldn't get the ThirdParty recipe working quickly, though..
r
hmm. that's strange
2 Views