Skip to content

Commit 5b2a011

Browse files
nstapelbroekjoshcanhelp
authored andcommitted
Make Auth0Service constructor arguments required
Dropped BC constructor logic to stimulate moving all constructor and configuration logic to a centralized place e.g. a service provider.
1 parent b469e2a commit 5b2a011

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

src/Auth0/Login/Auth0Service.php

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@
22

33
namespace Auth0\Login;
44

5-
use Auth0\SDK\API\Helpers\State\SessionStateHandler;
65
use Auth0\SDK\API\Helpers\State\StateHandler;
76
use Auth0\SDK\Auth0;
87
use Auth0\SDK\Helpers\Cache\CacheHandler;
98
use Auth0\SDK\JWTVerifier;
109
use Auth0\SDK\Store\StoreInterface;
1110
use Config;
12-
use Illuminate\Contracts\Config\Repository;
1311
use Illuminate\Contracts\Container\BindingResolutionException;
1412
use Illuminate\Http\RedirectResponse;
1513

@@ -37,22 +35,11 @@ class Auth0Service
3735
* @throws \Auth0\SDK\Exception\CoreException
3836
*/
3937
public function __construct(
40-
array $auth0Config = null,
41-
StoreInterface $sessionStorage = null,
42-
StateHandler $stateHandler = null
38+
array $auth0Config,
39+
StoreInterface $sessionStorage,
40+
StateHandler $stateHandler
4341
)
4442
{
45-
// Backwards compatible fallbacks
46-
if (!$auth0Config instanceof Repository && !is_array($auth0Config)) {
47-
$auth0Config = config('laravel-auth0');
48-
}
49-
if (!$sessionStorage instanceof StoreInterface) {
50-
$sessionStorage = new LaravelSessionStore();
51-
}
52-
if (!$stateHandler instanceof StateHandler) {
53-
$stateHandler = new SessionStateHandler($sessionStorage);
54-
}
55-
5643
$auth0Config['store'] = $sessionStorage;
5744
$auth0Config['state_handler'] = $stateHandler;
5845
$this->auth0 = new Auth0($auth0Config);

0 commit comments

Comments
 (0)