@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | private static function verifyToken(string $jwt, string $uri, bool $jwk = false): object |
| 101 | 101 | { |
| 102 | 102 | $kid = self::getKid($jwt); |
| 103 | - if (! $kid) { |
|
| 103 | + if (!$kid) { |
|
| 104 | 104 | throw authException::auth(422, 'Malformed JWT'); |
| 105 | 105 | } |
| 106 | 106 | if (config('jwtAuthRoles.cache.enabled')) { |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | ? self::getJwk($kid, $uri) |
| 117 | 117 | : self::getPem($kid, $uri); |
| 118 | 118 | |
| 119 | - if (! isset($publicKey) || ! $publicKey) { |
|
| 119 | + if (!isset($publicKey) || !$publicKey) { |
|
| 120 | 120 | throw authException::auth(500, 'Unable to validate JWT'); |
| 121 | 121 | } |
| 122 | 122 | |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | ? config('jwtAuthRoles.jwkUri') |
| 139 | 139 | : config('jwtAuthRoles.pemUri'); |
| 140 | 140 | |
| 141 | - if (! config('jwtAuthRoles.validateJwt')) { |
|
| 141 | + if (!config('jwtAuthRoles.validateJwt')) { |
|
| 142 | 142 | $claims = self::getClaims($jwt); |
| 143 | 143 | } else { |
| 144 | 144 | $claims = self::verifyToken($jwt, $uri, config('jwtAuthRoles.useJwk')); |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | if (config('jwtAuthRoles.autoCreateRoles')) { |
| 160 | 160 | foreach ($claims->roles as $role) { |
| 161 | 161 | $db_role = Role::where('name', $role)->first(); |
| 162 | - if (! $db_role) { |
|
| 162 | + if (!$db_role) { |
|
| 163 | 163 | Role::create(['name' => $role, 'guard_name' => 'jwt']); |
| 164 | 164 | } |
| 165 | 165 | } |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | $this->mergeConfigFrom(__DIR__.'/../config/jwtAuthRoles.php', 'jwtAuthRoles'); |
| 42 | 42 | |
| 43 | 43 | // Register the service the package provides. |
| 44 | - $this->app->singleton('jwtAuthRoles', function ($app) { |
|
| 44 | + $this->app->singleton('jwtAuthRoles', function($app) { |
|
| 45 | 45 | return new jwtAuthRoles; |
| 46 | 46 | }); |
| 47 | 47 | } |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | $timestamp = date('Y_m_d_His'); |
| 99 | 99 | |
| 100 | 100 | return Collection::make($this->app->databasePath().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR) |
| 101 | - ->flatMap(function ($path) use ($filesystem) { |
|
| 101 | + ->flatMap(function($path) use ($filesystem) { |
|
| 102 | 102 | return $filesystem->glob($path.'*_create_jwtauth_tables.php'); |
| 103 | 103 | })->push($this->app->databasePath()."/migrations/{$timestamp}_create_jwtauth_tables.php") |
| 104 | 104 | ->first(); |