-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How add custom Claims? #44
Comments
which version are you using? |
It looks like you're probably using You can pass an array of custom claims via the second parameter on the $customClaims = ['foo' => 'bar', 'baz' => 'bob'];
$token = JWTAuth::fromUser(User::first(), $customClaims); Alternatively if you are manually creating the token via the $customClaims = ['foo' => 'bar', 'baz' => 'bob'];
$payload = app('tymon.jwt.payload.factory')->make($customClaims);
$token = JWTAuth::encode($payload); |
Yes I'm using dev-laravel-5 Thank you |
Can someone please have a look at this issue #771 its kind of similar.
The above gave you a private token string how do I get a public one. |
I am trying with JWTAuth::encode();
Argument 1 passed to Tymon\JWTAuth\JWTManager::encode() must be an instance of Tymon\JWTAuth\Payload, array given
The text was updated successfully, but these errors were encountered: