mercredi 11 avril 2018

How to integrate different user types with JWT ?

I created a new user type called BizUser (business user). Now, when calling this route:

Route::group(['prefix' => 'business-user', 'middleware' => ['jwt.auth']], function () {
    Route::post('/', 'UsersController@store');
});

I receive this exception:

Call to undefined methoIlluminate\\Auth\\TokenGuard::onceUsingId()

This is from jwt.php:

/*
|--------------------------------------------------------------------------
| User Model namespace
|--------------------------------------------------------------------------
|
| Specify the full namespace to your User model.
| e.g. 'Acme\Entities\User'
|
*/

'user' => App\Services\Users\User::class,

I tried doing this:

'user' => [App\Services\Users\User::class,App\Services\Users\BizUser::class],

Which produced this error:

llegal offset type in isset or empty"]}{"success":false,"message":["Illegal offset type in isset or empty



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire