Skip to content

Multiple Guards #1609

@ItsRD

Description

@ItsRD
  • Passport Version: v11.3.1
  • Laravel Version: v9.43.0
  • PHP Version: 8.1.11
  • Database Driver & Version: MySQL 5.7.39

Description:

I'm working on a project with multiple guard. The regular web guard and the admin guard.
In the AuthorizationController on line 97 it requests the user, without any guard as parameter. Because of this it tries to get the web user and not the admin user. I'm not sure if I did forget something while setting up multiple guards or this is a bug.

When I change $user = $request->user(); to $user = $request->user(config('passport.guard')); it works fine.

Steps To Reproduce:

  • I've added a new guard, new provider and Admin model.
  • I installed Laravel passport
  • Changed the provider in the oauth_clients table to the name of my new provider (called admins).
  • Published the config and changed the guard to admin

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions