-
Notifications
You must be signed in to change notification settings - Fork 783
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
Laravel 7.5.2 (Passport Api) + Vuejs Error : Undefined index: aud , \vendor\laravel\passport\src\Guards\TokenGuard.php #1243
Comments
Same here |
Facing the same issue |
Having the same issue but with laravel 6 and passport 9. |
I think I might have found the issue. Looks like But when decoding the cookie and trying to find the corresponding user However, the indexes have been like that for a LONG time now, so I'm not sure why this is suddenly a problem? |
I suspect it might be due to the removal of old Reverting to 8.x branch resolved the issue for me.
|
The problem isn't with the |
Looking at the diff, this seems to be the culprit (as it apparently assumes that @driesvints do you have any idea on how can we solve this? |
@lcobucci your link only shows all the commits between 8.5 and 9.0. Can you link to the specific file or pr that changed this? |
Did everyone here read the upgrade guide and added the new provider column to the clients table? |
I've updated it already, sorry |
@driesvints column is there in my case (I'm doing a clean |
Hey @driesvints yeah this was happening for me on a fresh project, |
It's mentioned that people are here using vue but I don't see any vuejs install steps in the steps to reproduce. Can anyone please post very specific steps to replicate this? |
Hey, I'm on a fresh install also. On version
|
If anyone can please post very specific steps to reproduce we can figure this out. Atm we can't reproduce this. |
/**
* Get the user for the incoming request.
*
* @param \Illuminate\Http\Request $request
* @return mixed
*/
public function user(Request $request)
{
if ($request->bearerToken()) {
return $this->hasValidProvider($request) ? $this->authenticateViaBearerToken($request) : null;
} elseif ($request->cookie(Passport::cookie())) {
return $this->authenticateViaCookie($request);
}
} This may be the fix needed but I can't reproduce the error. Seeing how there is no client in this case makes sense logically but I need to verify. Can someone please give details steps as @driesvints has mentioned. |
In my instance I'm using React.
|
Thanks, @joelennon for the detailed write-up. This was a great help in tracking this down. I have submitted a PR to resolve this. Please look at #1246 |
Thanks @joelennon, that was helpful 👍 |
Released v9.0.1 which should fix this. |
Thanks everyone, the fix works nicely 👍 |
Thanks to everyone who reported this! |
Thanks everyone |
If anyone here who has upgraded to v9 already and is using the new secrets hashing, please read https://blog.laravel.com/passport-v91-breaking-changes and #1252 |
Ugg this cost me a lot of time earlier this week, happy to read I'm not crazy :) |
I still can't resolve this in my case. I have a new laravel installation with the latest passport package installed. |
Description:
I am using Laravel 7.5.2 with Vuejs. I am using passport for api authentication. I am getting the following error when sending ajax request to api
Steps To Reproduce:
I have followed passport installation instruction on laravel website.
The cookie named "laravel_token" is getting generated and sent with ajax request as I can see in developer tool.
In my controller I have included api middleware as
The text was updated successfully, but these errors were encountered: