From 315ae80d370acff3ae5d63fea94eb52ab375b946 Mon Sep 17 00:00:00 2001 From: xiaomlove <353856593@qq.com> Date: Fri, 9 Aug 2024 03:12:52 +0800 Subject: [PATCH] fix AuthServiceProvider Passport not found --- app/Providers/AuthServiceProvider.php | 4 +++- include/constants.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php index 063c8b5ea..c699af7a3 100644 --- a/app/Providers/AuthServiceProvider.php +++ b/app/Providers/AuthServiceProvider.php @@ -56,7 +56,9 @@ class AuthServiceProvider extends ServiceProvider public function boot() { $this->registerPolicies(); - Passport::useClientModel(OauthClient::class); + if (class_exists(Passport::class)) { + Passport::useClientModel(OauthClient::class); + } Auth::viaRequest('nexus-cookie', function (Request $request) { return $this->getUserByCookie($request->cookie()); diff --git a/include/constants.php b/include/constants.php index ad8d77882..5523ddd35 100644 --- a/include/constants.php +++ b/include/constants.php @@ -1,6 +1,6 @@