-
Notifications
You must be signed in to change notification settings - Fork 784
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
Passport 4 TokenGuard and Laravel 5.5.42 don't work together #805
Comments
This is the function in the middleware to make it work btw, it serializes only the passport cookie and uses the $serialize property for the rest. /**
* Determine if the cookie contents should be serialized.
*
* @param string $name
* @return bool
*/
public static function serialized($name)
{
// Work around the fact that passport:4 can't handle
// the cookie serialization fix of laravel 5.5.42
if (class_exists(Passport::class) && $name === Passport::$cookie) {
return true;
}
return static::$serialize;
} |
Hi. I have the same issue. I tried your solution @Zae but now I'm getting this error:
I cleared all the cache and sessions just in case. I'm using Laravel 5.5.42 and Passport 4.0.3. Do you have any idea what to do? EDITED: |
@Zae your solution worked for me as well. Is this something fixed in a later release of passport? If we are sticking with 5.5.x laravel, should we be using only passport 4.x or can we upgrade passport? |
@walliby This is fixed in the latest version, but you need laravel 5.6 for that, the passport version for laravel 5.5 doesn't have this fix (yet). Because i'm still stuck on laravel 5.5 I couldn't use the newer version of passport. |
I modified my
|
Heya, unfortunately we don't support such an old Passport version anymore. Please upgrade to the latest version to see if the problem persists. |
But Laravel 5.5 is the LTS release and Passport v4 has a bug that means it won't work since version Laravel 5.5.42. Isn't Passport an official Laravel package? |
Laravel 5.5 is indeed LTS but Passport 4.0 isn't. |
Then shouldn't this be documented somewhere? |
I don't know what you mean? It's never been said that Laravel's other libraries had any LTS releases? |
This is an issue for anyone using Passport with Laravel 5.5. Laravel 5.5 is an LTS release, whether Passport 4 is or not. People are going to encounter this problem, so shouldn't it be documented somewhere about how to deal with the issue? Your suggestion to upgrade Passport isn't possible for some as they're on the LTS version of Laravel, which is only compatible with an outdated version of Passport. I'm just suggesting the fix from @Zae maybe should be documented. |
I agree this is a problem. This means anybody using the latest version of Laravel 5.5 which is LTS cannot configure Passport out of the box. At the very least, the laravel documentation located here should be updated: https://laravel.com/docs/5.5/passport#installation |
You're free to send in a PR. Make sure you link back to this issue so Taylor knows why you're sending it in. |
it works |
@Zae, So, it is not passing the condition in Laravel : 5.5.44 |
Hi,
I noticed that my auth was broken in passport after upgrading to 5.5.42, it seems that passport uses the decrypt method without checking the $serialize property in the encryptcookie middleware and that causes passport to try and unserialize the cookie even if it is not serialized. Causing an exception and ultimately the auth to fail.
I added a check to my middleware to still serialize the passport cookie to work around this for now.
The text was updated successfully, but these errors were encountered: