There is a overload error here, if i remove the Ex...
# support-questions-legacy
y
There is a overload error here, if i remove the Express.response. If I remove the Express.response type, typescript fails to compile
r
hey @yadedyash
y
Good morning my friend how you doing?
r
im doing well. Thanks! How are you?
y
Iโ€™m great! Just banging my head against the wall lol
r
You need to use the
req: SessionRequest, res: Express.Response
to get the correct typing.
when you do
req.session!.getUserId()
what do you get back?
y
Give me one moment, will get right back to you
Console spits out nothing bro
r
can i see some code?
Can you do the console long after calling getUserId?
y
as in immediatley after line 110?
same exact log?
r
Yes
Did you call the api?
y
as in like fetching the endpoint? no
sorry im self taught
I am very much teaching myself as i go
r
I see. Not sure if this is the right place for this then. Sorry.
y
Is there any documentation you would recommend I read for this
r
Not specifically. Our docs are quite extensive already.
y
Got it, when I call the get api in postman it gives me a message: unauthorized object
If that helps at all
otherwise I do not know what exactly I am doing wrong
r
Yup. It means you need to first login.
y
Strange, since I am logged in.
like i said earlier, if i follow the docs and use the getUserByEmail method everything works fine
the issue for me is im not sure how to get user email from the session dynamically in the backend
r
Did you call the login api via postman first?
y
I did. Whats strange is that when i run my environment I am very clearly logged in, and i can display the correct UserID in my frontend which I match with the userID in the dashboard, this is following the react docs
r
Consider enabling backend debug logs and then calling the api from postman. It might give you a hint on whatโ€™s wrong
y
Thanks, will try that. Enjoy the rest of your day. I had a call set up for 10:30 pm pacific tonight, shall i cancel that if this is not really the place for one man project questions?
r
Yes please ๐Ÿ™‚
y
Got it. Thanks for your time, again I apologize if I wasted your time or this was not the appropriate forum, I am not new to development anymore but this is very much my first fully featured client project. Thanks again.
r
Happy to help ๐Ÿ™‚ Good luck.