Multi Auth with Laravel 5.4 and Passport

后端 未结 7 2131
猫巷女王i
猫巷女王i 2020-12-31 20:46

I am trying to setup multi auth with Laravel Passport, but it doesn\'t seem to support it. I am using the Password Grant to issue tokens which requires me to pass username/p

7条回答
  •  天命终不由人
    2020-12-31 21:30

    Laravel passport is only working with User as a provider. Even if you fetch token by adding above changes with PasswordGrant & UserRepository, while you go for API call for Post and get requests are not working with changed passport provider other than User.

    Better you create multi auth with session driver if must needed as Vendors and Customers. let 'User' model only for passport whose table columns supports admin, API, vendor, etc.

    Repo here laravel-multiAuth

提交回复
热议问题