https://supertokens.com/ logo
d

Dhr_RT

04/10/2022, 12:21 PM
@rp Hello, I need to have the full authResponseObject from the Google Recipe to be available to me outside of the initial POST SignUp function. How can I store and access this? (I believe my request was passed to you too on LinkedIN)
r

rp

04/10/2022, 12:21 PM
Hey!
d

Dhr_RT

04/10/2022, 12:21 PM
hey!
r

rp

04/10/2022, 12:21 PM
You can store this in the sessionData
Like session.updateSessionData
And then in your APIs, post session verification, you can fetch this like session.getSessionData()
d

Dhr_RT

04/10/2022, 12:22 PM
That is what I have here
Now I need to add another override to enhance the session right?
r

rp

04/10/2022, 12:23 PM
Not necessary
The response object has session in it
So where you are doing a console log, you can do response.session.updateSessionData(..)
d

Dhr_RT

04/10/2022, 12:23 PM
aha
Checking
r

rp

04/10/2022, 12:24 PM
Well it should be await response.session…
d

Dhr_RT

04/10/2022, 12:25 PM
đź‘€ I see the async haha
Something else, I am also getting a loop whenever the api is unauthorized
It will keep on trying to endpoint?
r

rp

04/10/2022, 12:31 PM
Not really. How are you handling 401?
On the frontend
d

Dhr_RT

04/10/2022, 12:34 PM
it is is a try catch, and right now I have it returning me the message from the api
This is the trigger
Do note I broke up a lot of my code just for this PoC
r

rp

04/10/2022, 12:36 PM
Ah ok. Can you enable debug logging on the backend and try this API and then send me the logs
d

Dhr_RT

04/10/2022, 12:37 PM
sure
r

rp

04/10/2022, 12:37 PM
(Please make sure you are using the latest node SDK version). The debug logs is a new feature.
d

Dhr_RT

04/10/2022, 12:40 PM
I think it was part of my code, now I am returning a hard coded empty object as response, and the looping is no longer there. I will do another check
r

rp

04/10/2022, 12:42 PM
ok
d

Dhr_RT

04/10/2022, 12:43 PM
How should i tap into the added session data?
req.session
?
r

rp

04/10/2022, 12:44 PM
await req.session.getSessionData()
d

Dhr_RT

04/10/2022, 12:45 PM
Beautiful
Right now I have it like this. Can I ask you, should I rather move the req.session into the authenticated function?
r

rp

04/10/2022, 12:48 PM
im not sure what you mean by "authenticated function". But you should do
req.session
inside an API that has used the
verifySession
middleware.
d

Dhr_RT

04/10/2022, 12:48 PM
I will keep it like this
Thanks a bunch for the help