Hey people, I wanted to implement my own endpoint for signin where I do some logic and after that I ...
d
Hey people, I wanted to implement my own endpoint for signin where I do some logic and after that I call the EmailPassword.signIn(email, password) to signin the user and respond to frontend with my added data. But it seems to be missing the headers which has all the session data. What is a good way to do this?
r
Hey @Dalai Llama
After calling sign in, you need to take the user id and call the await Session.createNewSession function
d
Hmm, I did it following this example for nestjs: https://supertokens.com/docs/session/common-customizations/sessions/new-session but the request hangs on status pending
it attaches the tokens to the response headers but then it cannot respond back it seems. Just gets stuck.
r
you need to send some response after the createNewSession returns.
like
res.json(..)
or however you send a response.
d
ah thanks, I was returning res but it needed to be in json format