-
Notifications
You must be signed in to change notification settings - Fork 41
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
[QUESTION] Auth::attempt does not return token #34
Comments
Same here. According to README |
@gronostajo |
I think you may be using laravel's native auth attempt instead of JWTs. If so laravel's Auth::attempt always returns a boolean as can be seen in Even so I also got something similar: I'm working with multiple guards, got confused and was passing one guard that would do the "website" session authentication instead of the one that would do the jwt authentication for the api. By doing this it was returning only true instead of the token. Observation: if you don't define a guard it will run the default one, that may not be the one you want. And also while debugging I could not find out how to pass the expected guard when directly trying to do JWTAuth::attempt instead of $this->guard()->attempt. Hopefully it was not necessary. |
If anyone still got this issue, change it to |
check this link: |
I came across the same problem. The issue was that I was passing the remember flag to the attempt method: auth()->attempt($this->credentials($request)); // this works auth()->attempt($this->credentials($request), $rememeber = true); // this does not work Hope this helps! |
I have the same problem! |
I found exactly the same, what can we do to use the remember token? |
if you changed
in |
This is my first time to add comment in github. I just want to share that this setup works for me. Let me know if this works to you as well. composer.json
bootstrap/app.php
Models/User.php
AuthController.php
config/auth.php
|
the problem is: the password stored in the database without encrypting it, and when we do the logging the JWT package crypt the password by default, and when comparing between the password stored in the database and the cryptid password coming from the form data the auth()->attemp($cren) return always false because the password != hash(password). |
this method doesn't work for me |
Please prefix your issue with one of the following: [BUG] [PROPOSAL] [QUESTION].
In raising this issue, I confirm the following (please check boxes):
My familiarity with the project is as follows (check one):
My project stack details
tymon/jwt-auth
Version: ^1.0@dev{issue content here}
$token = Auth::attempt(['email' => '[email protected]', 'password' => '123456']);
returnstrue
instead of token as stated in documentation. May I know if I missed anything?The text was updated successfully, but these errors were encountered: