Hello team, Could you please help me with this? ...
# support-questions
a
Hello team, Could you please help me with this? At backend:
await ThirdPartyPasswordless.getUserById(ses.getUserId())
returns
undefined
even if
req.session
returns the session object with valid session. At frontend: I am receiving a valid response with status: "OK" This all thing happens during first login only. After that it works without any errors? Any idea why does this happen?
r
hey @Abhi
The session recipe is independent and doesn't require you to create a user in supertokens.
so if you have not created a user in thirdpartypasswordless, but created the user somehow else, this is what happens.
a
I have overrided
thirdPartySignInUpPOST
and
consumeCodePOST
which returns
riginalImplementation.consumeCodePOST(input);
as a response. This creates a user in supertokens which I can see in supertokens dashboard.
The issue arises only at the first login and not subsequent logins.
r
"The issue arises only at the first login and not subsequent logins." -> i don't understand this statement
a
if
response.createdNewUser == true
the issue arises else
No issue at all
r
i see.
Where are you calling
await ThirdPartyPasswordless.getUserById(ses.getUserId())
?
a
When the user logs in his info is fetched by getting email from
await ThirdPartyPasswordless.getUserById(ses.getUserId())
at the backend
r
im not sure how this would be possible. If the user signs up using the
ThirdPartyPasswordless
recipe, then getting that user via that recipe post sign up would yield their user object. Are you doing some sort of user ID mapping?
2 Views