From a4fc478baf6d181d2312291eb5408b7ff5b908d2 Mon Sep 17 00:00:00 2001 From: Emmanuel Oduro Date: Fri, 31 Aug 2018 16:25:01 +0000 Subject: [PATCH] SMartins\PassportMultiauth Support --- src/CouchbasePassportServiceProvider.php | 42 +++++++++++++----------- src/Passport/Provider.php | 25 ++++++++++++++ 2 files changed, 47 insertions(+), 20 deletions(-) create mode 100644 src/Passport/Provider.php diff --git a/src/CouchbasePassportServiceProvider.php b/src/CouchbasePassportServiceProvider.php index b42e257..1635bd5 100644 --- a/src/CouchbasePassportServiceProvider.php +++ b/src/CouchbasePassportServiceProvider.php @@ -9,7 +9,7 @@ use Pedmindset\Couchbase\Passport\Token; use Pedmindset\Couchbase\Passport\TokenRepository; use Pedmindset\Couchbase\Passport\RefreshTokenRepository; - +use Pedmindset\Couchbase\Passport\Provider; class CouchbasePassportServiceProvider extends ServiceProvider @@ -19,24 +19,26 @@ public function register() /* * Passport client extends Eloquent model by default, so we alias them. */ - if (class_exists('Illuminate\Foundation\AliasLoader')) { - $loader = \Illuminate\Foundation\AliasLoader::getInstance(); - $loader->alias('Laravel\Passport\AuthCode', AuthCode::class); - $loader->alias('Laravel\Passport\Client', Client::class); - $loader->alias('Laravel\Passport\PersonalAccessClient', PersonalAccessClient::class); - $loader->alias('Laravel\Passport\Token', Token::class); - $loader->alias('Laravel\Passport\TokenRepository', TokenRepository::class); - $loader->alias('Laravel\Passport\Bridge\RefreshTokenRepository', RefreshTokenRepository::class); - - } else { - class_alias('Laravel\Passport\AuthCode', AuthCode::class); - class_alias('Laravel\Passport\Client', Client::class); - class_alias('Laravel\Passport\PersonalAccessClient', PersonalAccessClient::class); - class_alias('Laravel\Passport\Token', Token::class); - class_alias('Laravel\Passport\TokenRepository', TokenRepository::class); - class_alias('Laravel\Passport\Bridge\RefreshTokenRepository', RefreshTokenRepository::class); - - - } + if (class_exists('Illuminate\Foundation\AliasLoader')) { + $loader = \Illuminate\Foundation\AliasLoader::getInstance(); + $loader->alias('Laravel\Passport\AuthCode', AuthCode::class); + $loader->alias('Laravel\Passport\Client', Client::class); + $loader->alias('Laravel\Passport\PersonalAccessClient', PersonalAccessClient::class); + $loader->alias('Laravel\Passport\Token', Token::class); + $loader->alias('Laravel\Passport\TokenRepository', TokenRepository::class); + $loader->alias('Laravel\Passport\Bridge\RefreshTokenRepository', RefreshTokenRepository::class); + $loader->alias('Laravel\Passport\Bridge\RefreshTokenRepository', RefreshTokenRepository::class); + $loader->alias('SMartins\PassportMultiauth\Provider', Provider::class); + + + } else { + class_alias('Laravel\Passport\AuthCode', AuthCode::class); + class_alias('Laravel\Passport\Client', Client::class); + class_alias('Laravel\Passport\PersonalAccessClient', PersonalAccessClient::class); + class_alias('Laravel\Passport\Token', Token::class); + class_alias('Laravel\Passport\TokenRepository', TokenRepository::class); + class_alias('Laravel\Passport\Bridge\RefreshTokenRepository', RefreshTokenRepository::class); + class_alias('SMartins\PassportMultiauth\Provider', Provider::class); + } } } diff --git a/src/Passport/Provider.php b/src/Passport/Provider.php new file mode 100644 index 0000000..ddf67c7 --- /dev/null +++ b/src/Passport/Provider.php @@ -0,0 +1,25 @@ +