I have built an API using Laravel, with Laravel Passport. Everything works great, but what I'm trying to achive now, is to build a new API using AdonisJs - for a few smaller things for the website but have the authentication same for both framework's - which I guess is possible using the JWT token.
Both Laravel and Adonis are configured to use the same private / public keys for encrypting. The problem I`m facing is that after logging-in via Laravel, I cant read the user from the token, and thats due to the JWT object being different.
Adonis expects the payload to have a uid propery, which doesnt exists in Laravel passport made token.
Below is the token created by passport:
{ aud: '9',
jti:
'ab9d81a20ed72e263f3f6bacef91962bfcb41b5523787fa301f56fa4978e5ae9ceb22dccbfb9fcef',
iat: 1575970326,
nbf: 1575970326,
exp: 1607592726,
sub: '332',
scopes: [],
}
And ,here is the token created by Adonis
{ uid: 332, iat: 1575971236 }
There is any way to either set uid from Laravel, or read a different field from Adonis?
Thanks!