Open imranalii opened 7 years ago
me to same problem
Same problem, bump
Same problem, bump
@tymondesigns :/
What version of jwt-auth are you guys using?
@tymondesigns im using 0.5.9
There is no guard support for 0.5. You will need to use one of the latest 1.0.0- versions.
The official docs for 1.0.0 are not complete just yet, but there is a quick setup guide lurking in the issues. I'll link to it when I'm not on my phone...
Actually found it #860
👍
I'm having the same issue for Lumen. Using 1.0.0.* For some reason the JWTAuth::attempt($credentials) keeps giving me a invalid_credentials for a Model that's not having the default users table (my database table is user).
Nevermind I'm trollin, my password in my database wasn't minimum 60 characters was 45. Works fine thanks for making this for Lumen and Laravel @tymondesigns
Same problem, bump bump. have any solution?
Another reason is to use the user object to create a license
$token = JWTAuth::fromUser($user)
try { // attempt to verify the credentials and create a token for the user if (!$token = JWTAuth::fromUser($user)) { return response()->json(['error' => 'invalid_credentials'], 401); } } catch (JWTException $e) { // something went wrong whilst attempting to encode the token return response()->json(['error' => 'could_not_create_token'], 500); }
Hi, I've implemented JWT for Laravel 5.4 & its working fine with users model. I need JWT to work for other table "app_users" not users. I've changed "user model namespace" to app_users under config/jwt.php
'user' => 'App\Models\AppUsers',
Following is authenticate function:try { // verify the credentials and create a token for the user if (! $token = JWTAuth::attempt($credentials)) { return response()->json(['error' => 'invalid_credentials'], 401); } } catch (JWTException $e) { // something went wrong return response()->json(['error' => 'could_not_create_token'], 500); }
Moreover, config/auth.php
'guards' => [ 'web' => [ 'driver' => 'session', 'provider' => 'users', ], 'api' => [ 'driver' => 'token', 'provider' => 'app_users', ], ],
Just wanted to know which guard is called default by JWT. I want it to call "api" guard. Also, driver token for api guard always throw below error.Call to undefined method Illuminate\Auth\TokenGuard::attempt()
If I change it to "jwt-auth" it throws follwing error:Auth guard driver [api] is not defined.
so let me know which guard to use? Thanks a lot.