Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
HergenD authored and StyleCIBot committed Sep 14, 2020
1 parent 3e6bbe5 commit ee442b6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/Models/JwtUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace werk365\jwtauthroles\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Spatie\Permission\Traits\HasRoles;

Expand Down
6 changes: 3 additions & 3 deletions src/jwtAuthRoles.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace werk365\jwtauthroles;

use werk365\jwtauthroles\Models\JwtUser;
use Firebase\JWT\JWT;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Str;
Expand All @@ -11,10 +10,10 @@
use Spatie\Permission\Models\Role;
use werk365\jwtauthroles\Exceptions\authException;
use werk365\jwtauthroles\Models\JwtKey;
use werk365\jwtauthroles\Models\JwtUser;

class jwtAuthRoles
{

private static function getKid(string $jwt): ?string
{
if (Str::is('*.*.*', $jwt)) {
Expand All @@ -34,6 +33,7 @@ private static function getClaims(string $jwt): ?object
if (Str::is('*.*.*', $jwt)) {
$claims = explode('.', $jwt);
$claims = JWT::jsonDecode(JWT::urlsafeB64Decode($claims[1]));

return $claims ?? null;
} else {
throw authException::auth(422, 'Malformed JWT');
Expand Down Expand Up @@ -138,7 +138,7 @@ public static function authUser(object $request)
? config('jwtAuthRoles.jwkUri')
: config('jwtAuthRoles.pemUri');

if (!config('jwtAuthRoles.validateJwt')) {
if (! config('jwtAuthRoles.validateJwt')) {
$claims = self::getClaims($jwt);
} else {
$claims = self::verifyToken($jwt, $uri, config('jwtAuthRoles.useJwk'));
Expand Down
2 changes: 1 addition & 1 deletion src/jwtAuthRolesServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function boot(Filesystem $filesystem)
], 'config');

$this->publishes([
__DIR__ . '/../database/migrations/create_jwtauth_tables.php.stub' => $this->getMigrationFileName($filesystem),
__DIR__.'/../database/migrations/create_jwtauth_tables.php.stub' => $this->getMigrationFileName($filesystem),
], 'migrations');
}
}
Expand Down

0 comments on commit ee442b6

Please sign in to comment.