Open mshahinaz29 opened 3 years ago
Looks like this is a bug of laravel/passport:^8
https://github.com/laravel/passport/blob/6affa6ed600c5f8909385fbae7cf6f8af3db2d39/src/Guards/TokenGuard.php#L251
protected function decodeJwtTokenCookie($request)
{
return (array) JWT::decode(
$this->encrypter->decrypt($request->cookie(Passport::cookie()), Passport::$unserializesCookies),
$this->encrypter->getKey(),
['HS256']
);
}
Upgrade to laravel/passport:^9
will fix it
Quick Fix: Replace
$this->encrypter->decrypt($request->cookie(Passport::cookie()), Passport::$unserializesCookies),
with
substr($this->encrypter->decrypt($request->cookie(Passport::cookie()), Passport::$unserializesCookies), 41),
Quick Fix: Replace
$this->encrypter->decrypt($request->cookie(Passport::cookie()), Passport::$unserializesCookies),
with
substr($this->encrypter->decrypt($request->cookie(Passport::cookie()), Passport::$unserializesCookies), 41),
Having the same issue and this doesn't fix my problem sadly.
Any ideas what could be done?
@sbarbat I tried for a few hours now and can't figure out what's wrong. Can you please provide some assistance? I really need this package to work, as it's amazing and exactly what I need for my project.
Thank you and sorry for tagging you.
Sorry thaat havent got any time to look into this, will do it this weekend! 💪 @KnowledgeWanderer
@sbarbat no need to be sorry, you did something great here, that's free and open source. If what I want to make will work, I'll support this project and pump some money into it. Thinking of actually donating towards it nevertheless, but it has to work well first of all.
I have the same issue @sbarbat
composer.lock Laravel 8.7 Passsport 10.2 chatter-laravel/core dev-master c3a447f
When I click the Ask a Question button I get a console error shown in attached screen shot. The first error, api/chatter/discussion 401, happens on the click.
The second error, Error: Request failed with status code 401...app.js:2539:17, occurs on loading the new page which is the default home page /home
I'm planning (hoping) to use this in production and will happily contribute $$$ to its upkeep.
As a follow up, if I hit the page directly it returns a properly formatted json file with chatter data. See attached @sbarbat ![Uploading Screen Shot 2021-12-07 at 7.08.37 PM.png…]()