Answer the question
In order to leave comments, you need to log in
Why doesn't it return a token?
I follow the guide https://www.tutsmake.com/laravel-8-rest-api-authen...
Returns this instead of a token
{
"token": {
"name": "Laravel8PassportAuth",
"abilities": [
"*"
],
"tokenable_id": 4,
"tokenable_type": "App\\Models\\User",
"updated_at": "2021-10-20T10:20:03.000000Z",
"created_at": "2021-10-20T10:20:03.000000Z",
"id": 22
}
}
Answer the question
In order to leave comments, you need to log in
Found an error. An invalid package was specified for the HasApiTokens trait.
use Laravel\Sanctum\HasApiTokens;
And it should be like this
use Laravel\Passport\HasApiTokens;
https://stackoverflow.com/a/69561615/17078920
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question