diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 6a263cd8..c9ff4921 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @auth0/sdk-team-approvers +* @auth0/dx-sdks-approver diff --git a/src/Auth0/Login/Auth0Service.php b/src/Auth0/Login/Auth0Service.php index bc8e1372..1f134ecb 100644 --- a/src/Auth0/Login/Auth0Service.php +++ b/src/Auth0/Login/Auth0Service.php @@ -2,13 +2,12 @@ namespace Auth0\Login; -use Auth0\SDK\API\Helpers\State\SessionStateHandler; +use Auth0\SDK\API\Helpers\State\StateHandler; use Auth0\SDK\Auth0; use Auth0\SDK\Helpers\Cache\CacheHandler; use Auth0\SDK\JWTVerifier; use Auth0\SDK\Store\StoreInterface; use Config; -use Illuminate\Contracts\Config\Repository; use Illuminate\Contracts\Container\BindingResolutionException; use Illuminate\Http\RedirectResponse; @@ -31,28 +30,18 @@ class Auth0Service * * @param array $auth0Config * @param StoreInterface $sessionStorage + * @param StateHandler|null $stateHandler * * @throws \Auth0\SDK\Exception\CoreException */ public function __construct( - array $auth0Config = null, - StoreInterface $sessionStorage = null, - SessionStateHandler $sessionStateHandler = null + array $auth0Config, + StoreInterface $sessionStorage, + StateHandler $stateHandler ) { - // Backwards compatible fallbacks - if (!$auth0Config instanceof Repository && !is_array($auth0Config)) { - $auth0Config = config('laravel-auth0'); - } - if (!$sessionStorage instanceof StoreInterface) { - $sessionStorage = new LaravelSessionStore(); - } - if (!$sessionStateHandler instanceof SessionStateHandler) { - $sessionStateHandler = new SessionStateHandler($sessionStorage); - } - $auth0Config['store'] = $sessionStorage; - $auth0Config['state_handler'] = $sessionStateHandler; + $auth0Config['state_handler'] = $stateHandler; $this->auth0 = new Auth0($auth0Config); } diff --git a/src/Auth0/Login/LoginServiceProvider.php b/src/Auth0/Login/LoginServiceProvider.php index 47fd620f..61299634 100644 --- a/src/Auth0/Login/LoginServiceProvider.php +++ b/src/Auth0/Login/LoginServiceProvider.php @@ -5,6 +5,7 @@ use Auth0\SDK\API\Helpers\ApiClient; use Auth0\SDK\API\Helpers\InformationHeaders; use Auth0\SDK\API\Helpers\State\SessionStateHandler; +use Auth0\SDK\API\Helpers\State\StateHandler; use Auth0\SDK\Store\StoreInterface; use Illuminate\Support\ServiceProvider; @@ -49,7 +50,7 @@ public function register() return new LaravelSessionStore(); }); - $this->app->bind(SessionStateHandler::class, function ($app) { + $this->app->bind(StateHandler::class, function ($app) { return new SessionStateHandler($app->make(LaravelSessionStore::class)); });