dimanche 12 février 2017

TokenGuard class always need api_token

I am using AngularJs and Laravel 5.3

In the default guard, I changed the web guard to api. Finally it looks like below.

'defaults' => [
    'guard' => 'api',
    'passwords' => 'users',
],

when i send the request using username and password from Angular Js....I always get invalid credentials because..

TokenGuard class has a method called validate which expects api_token value but I am on the login page.

I am assuming that in order to get the token, I need $this->guard(web) in login method?

Is it correct approach or Am I missing something?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire