So I've found this idea on the internet to log the user out of all of his devices with JWT, and that's by adding additional attribute in the user table. This is what my user model looks like.
{
"id": 2,
"role_id": 2,
"name": "Anna Cole",
"email": "emery.corwin@example.org",
"email_verified_at": null,
"created_at": "2022-09-06T10:10:31.000000Z",
"updated_at": "2022-09-11T05:55:54.000000Z",
"jwtv": "9222530",
},
this jwtv field will verify if the JWT is still useable, if the jwtv in the server doesn't match what's in the incoming JWT the server would return an error. How can I make this possible?
EDIT:
I've also tried
public function getJWTCustomClaims()
{
return [
"jwtv" => $this->jwtv
];
}
but this doesn't treat the jwtv as an additional identifier rather just as an additional information