yyogeshwar
04/05/2022, 2:21 PMPasswordless.consumeCode
I am getting below response -
{
status: 'OK',
createdNewUser: true,
user: {
phoneNumber: '+919644683149',
id: '32b3547d-395f-47b7-8946-c818aa56f4aa',
timeJoined: 1649160487992
}
}
Now i have user.id
, so on backend only how can we retrieve user accessToken / JWT token using user.id
rp_st
04/05/2022, 2:23 PMSession.createNewSession(res, userId)
and this will attach access / refresh tokens to the cookies and work along with the frontend SDK to maintain a secure session.
- use the JWT recipe to create a JWT using the userId above which you can send to the frontend and then verify that on your backend. This would work, but is less powerful and secure than the first method.rp_st
04/05/2022, 2:23 PMyyogeshwar
04/05/2022, 2:24 PMrp_st
04/05/2022, 2:24 PMyyogeshwar
04/05/2022, 2:24 PMrp_st
04/05/2022, 2:24 PMyyogeshwar
04/05/2022, 2:24 PMrp_st
04/05/2022, 2:24 PMrp_st
04/05/2022, 2:25 PMyyogeshwar
04/05/2022, 2:26 PMrp_st
04/05/2022, 2:27 PMcreateJWT({sub: userId}, ...);