teebot
02/16/2022, 10:38 AMgetAccessTokenPayloadSecurely
?rp
02/16/2022, 10:40 AMgetAccessTokenPayloadSecurely
is in RN land, so it's not available in native land.teebot
02/16/2022, 10:40 AMrp
02/16/2022, 10:40 AMteebot
02/16/2022, 10:40 AMrp
02/16/2022, 10:41 AMnkshah2
02/16/2022, 10:50 AMteebot
02/16/2022, 10:58 AMrp
02/16/2022, 10:59 AMnkshah2
02/16/2022, 11:01 AMrp
02/16/2022, 11:02 AMgetAccessTokenPayloadSecurely
function. Then that can be added as an authorisation bearer token to the request made by the third party, and your APIs would then need to also be able to verify a JWT as an alternate was of doing sessions.teebot
02/16/2022, 11:09 AMgetAccessTokenPayloadSecurely
? it seemed to be only the payload of the JWT without its signaturesFrontToken
as JWT token ?rp
02/16/2022, 11:14 AMgetAccessTokenPayloadSecurely
.
If you enable JWT, we create a separate JWT and put that inside the session's access token payload with the key as jwt
(by default).
So if you do await getAccessTokenPayloadSecurely()["jwt"]
, you will actually get the JWT string which you can then pass to your backendteebot
02/16/2022, 11:26 AM{
"phoneNumber": "+32468214620"
}
rp
02/16/2022, 11:26 AMteebot
02/16/2022, 11:28 AMrp
02/16/2022, 11:28 AMteebot
02/16/2022, 11:28 AMrp
02/16/2022, 11:28 AMteebot
02/16/2022, 12:43 PMSession.init({
jwt: {
enable: true
}
})
const session = await Session.createNewSession(
input.options.res,
user.id,
{
// we are adding the phoneNumber to the access token payload.
// This will also be accessible in all API calls + on the frontend.
phoneNumber
},
{}
);
rp
02/16/2022, 12:44 PMnkshah2
02/16/2022, 12:50 PMteebot
02/16/2022, 12:52 PMrp
02/16/2022, 12:53 PMnkshah2
02/16/2022, 1:02 PMteebot
02/16/2022, 1:27 PM