Hey I am currently facing an issue with the user ...
# support-questions-legacy
w
Hey I am currently facing an issue with the user management dashboard. Locally everything is working fine But once deployed (serverless to a Lambda), then the connection to the dashboard returns a 403. Can someone help me ?
r
Hey @whatsappxthomas
@nkshah2 can help here when he is free.
w
👍
Im sure it's stupid (like CORS) or something
but can't get my head around
r
Perhaps. Can you please also share the same set of screenshots you had shared on the website chat?
w
r
Hey @whatsappxthomas can you please update to the latest backend SDK and try again?
w
I am on the latest backend SDK
"supertokens-node": "^13.1.5"
r
I see. Okay. Can you please open an issue about this on our GitHub? We will have a look
w
What’s strange is that this works fine when I am on localhost
I can connect to the dashboard from local
r
Yea. I think it’s an issue with out aws lamda integration
w
OK
so I open an issue ?
r
Hey @whatsappxthomas I just saw our code. We don’t actually send back 403 from our APIs at all
Therefore this is not actually a bug in our SDK. But might be something related to how you have configured your aws lambda?
Does your app’s (not user management dashboard) sign in and stuff work?
w
yes I can sign in and connect to the user database
r
hmmmm interesting
okay. We shall investigate. Thanks
w
Just tried to open all CORS on my lambda config as well. Still does not work
r
i don't think that this is a cors issue
whats strange is that the supertokens middleware integration that serves the user's sign in / sign out etc is the same thing that also serves the dashboard APIs
w
do you have a hint of what it might be ?
r
are you self hosting the supertokens core?
w
nope
I am using the Managed Service Core.
r
i see. So there don't seem to be error on the core's side either. If you go to the supertokens.com dashboard, what version of the core is it running?
w
(v4.4)
r
right. So the issue is not on the core's side.
Can you enable backend debug logs for the backend sdk and share the output of that when you call the dashboard APIs?
w
Of course
r
w
can you walk me through or point me to the doc
👍
START 2023-03-25T14:11:05.673Z com.supertokens {t: "2023-03-25T14:11:05.673Z", message: "middleware: Started", file: "/var/task/node_modules/supertokens-node/lib/build/supertokens.js:230:26" sdkVer: "13.1.5"} 2023-03-25 15:11:05.673 INFO undefined 2023-03-25T14:11:05.674Z com.supertokens {t: "2023-03-25T14:11:05.674Z", message: "middleware: requestRID is: undefined", file: "/var/task/node_modules/supertokens-node/lib/build/supertokens.js:244:26" sdkVer: "13.1.5"} 2023-03-25 15:11:05.674 INFO undefined 2023-03-25T14:11:05.674Z com.supertokens {t: "2023-03-25T14:11:05.674Z", message: "middleware: Checking recipe ID for match: passwordless", file: "/var/task/node_modules/supertokens-node/lib/build/supertokens.js:292:34" sdkVer: "13.1.5"} 2023-03-25 15:11:05.674 INFO undefined 2023-03-25T14:11:05.674Z com.supertokens {t: "2023-03-25T14:11:05.674Z", message: "middleware: Checking recipe ID for match: dashboard", file: "/var/task/node_modules/supertokens-node/lib/build/supertokens.js:292:34" sdkVer: "13.1.5"} 2023-03-25 15:11:05.674 INFO undefined 2023-03-25T14:11:05.675Z com.supertokens {t: "2023-03-25T14:11:05.675Z", message: "middleware: Request being handled by recipe. ID is: /dashboard", file: "/var/task/node_modules/supertokens-node/lib/build/supertokens.js:297:38" sdkVer: "13.1.5"} 2023-03-25 15:11:05.675 INFO undefined 2023-03-25T14:11:05.677Z com.supertokens {t: "2023-03-25T14:11:05.677Z", message: "middleware: Ended", file: "/var/task/node_modules/supertokens-node/lib/build/supertokens.js:311:38" sdkVer: "13.1.5"} 2023-03-25 15:11:05.677 INFO undefined END Duration: 7.50 ms Memory Used: 135 MB
r
Is that all? Nothing more after the dashboard loads?
If nothing else, it means that the request for the APIs being called by the dashboard aren’t even reaching the lambda function. So the 403 is from aws’ side.
When you do a sign in api call in your app, what’s the url that the request goes to? Versus, when the dashboard loads, what’s the url that the dashboard goes to?
Oh. I think I see the issue. The frontend isn’t appending /prod to the url that the request is going to.
Can you share the url of your dashboard please?
r
and whats the backend config that you have? I mean the backend's supertokens.init config
specifically, what are you setting in the backend's appInfo?
w
appInfo: { appName: 'XXX', apiDomain: isProdStage() ? 'https://068y3ir4d1.execute-api.eu-central-1.amazonaws.com/prod/' : 'http://localhost:3000', websiteDomain: 'http://localhost:3001', apiBasePath: '/auth', websiteBasePath: '/auth', },
r
right, so i assume that the
/prod
part is the stage right?
in this case, you need to also set the apiGatewayPatth in the appInfo on the backend to
/prod
w
WDYM ?
the stage not the staging
yes, yes it is
r
right yea.
so you need to set the apiGatewayPath on the backend's appInfo (not the frontend's appInfo) to
/prod
and then try again - it should work
w
you mean there is an option to the appInfo I can add
r
yes
w
ok will try
w
just need to build and deploy
🥳
It does work
r
awesome!!
w
life save
dude, you're awesome
if this is support, I am definitely going for SuperToken for my all company !
💪
r
thank you 🙂 appreciate it
w
ok, I will add a comment on the issue for future references and close it
r
i already did
w
you read my mind 😄
ok nice
have a good one
see ya
r
to you as well.