0
I need to change my payload
of my JWT
to match the example below.
{
"iat": 1566408228,
"exp": 1566426828,
"email": "[email protected]",
"name": "Fulano Silva",
"roles": [
"manager"
]
}
0
I need to change my payload
of my JWT
to match the example below.
{
"iat": 1566408228,
"exp": 1566426828,
"email": "[email protected]",
"name": "Fulano Silva",
"roles": [
"manager"
]
}
0
I was able to solve it this way:
Model User
use Tymon\JWTAuth\Contracts\JWTSubject;
// Meu model agora implementa o JWTSubject
class User extends Authenticatable implements JWTSubject{
// Adicionei essa função
public function getJWTCustomClaims()
{
return [
'id' => $this->id,
'email' => $this->email,
'name' => $this->name,
];
}
}
Browser other questions tagged laravel jwt
You are not signed in. Login or sign up in order to post.
If you use a package
– novic