Closed fengerwoo closed 1 year ago
Question: did that happen outside the thinker environment too (eg. Web)?
Question: did that happen outside the thinker environment too (eg. Web)?
@Messhias Yes, so does the web
@Messhias Change the getJWTCustomClaims in the User Model to the following, and the token can be obtained, but I still don't know what the root problem is. When I used tymon/jwt-auth before, getJWTCustomClaims can return an empty array here
public function getJWTCustomClaims(){
return [ 'sub' => $this->id, ];
}
Modify screenshot
@Messhias Change the getJWTCustomClaims in the User Model to the following, and the token can be obtained, but I still don't know what the root problem is. When I used tymon/jwt-auth before, getJWTCustomClaims can return an empty array here
public function getJWTCustomClaims(){ return [ 'sub' => $this->id, ]; }
Modify screenshot
I did same as you and worked as well, @eschricker did that happens to you too?
I don't need to pass ['sub' => $this->id]
as custom claim.
I can't reproduce this error.
I tried to reproduce the error again and didn't happen, what could be happened it's the $subject it wasn't a string.
Subject of the issue
User failed to transfer to token
Your environment:
Steps to reproduce
The user failed to transfer to token. The specific error is reported
Operation screenshot
User Model implements are also correct