diff --git a/.env.example b/.env.example index e282046f9..6665c4b1a 100644 --- a/.env.example +++ b/.env.example @@ -1,7 +1,6 @@ APP_ENV=local APP_DEBUG=true APP_KEY=SomeRandomString -JWT_SECRET=ChangeMe DB_HOST=localhost DB_PORT=3306 diff --git a/composer.json b/composer.json index d56ce983f..ab9e728ff 100644 --- a/composer.json +++ b/composer.json @@ -14,8 +14,7 @@ "pragmarx/google2fa": "^0.7.1", "webpatser/laravel-uuid": "^2.0", "prologue/alerts": "^0.4.0", - "s1lentium/iptools": "^1.0", - "tymon/jwt-auth": "^0.5.6" + "s1lentium/iptools": "^1.0" }, "require-dev": { "fzaninotto/faker": "~1.4", diff --git a/config/app.php b/config/app.php index aa29a7be3..c054c592d 100644 --- a/config/app.php +++ b/config/app.php @@ -113,7 +113,6 @@ return [ 'providers' => [ Dingo\Api\Provider\LaravelServiceProvider::class, - Tymon\JWTAuth\Providers\JWTAuthServiceProvider::class, /* * Laravel Framework Service Providers... @@ -192,8 +191,6 @@ return [ 'Hash' => Illuminate\Support\Facades\Hash::class, 'Input' => Illuminate\Support\Facades\Input::class, 'Inspiring' => Illuminate\Foundation\Inspiring::class, - 'JWTAuth' => Tymon\JWTAuth\Facades\JWTAuth::class, - 'JWTFactory' => Tymon\JWTAuth\Facades\JWTFactory::class, 'Lang' => Illuminate\Support\Facades\Lang::class, 'Log' => Illuminate\Support\Facades\Log::class, 'Mail' => Illuminate\Support\Facades\Mail::class, diff --git a/config/jwt.php b/config/jwt.php deleted file mode 100644 index 7c1101320..000000000 --- a/config/jwt.php +++ /dev/null @@ -1,168 +0,0 @@ - env('JWT_SECRET', 'changeme'), - - /* - |-------------------------------------------------------------------------- - | JWT time to live - |-------------------------------------------------------------------------- - | - | Specify the length of time (in minutes) that the token will be valid for. - | Defaults to 1 hour - | - */ - - 'ttl' => 60, - - /* - |-------------------------------------------------------------------------- - | Refresh time to live - |-------------------------------------------------------------------------- - | - | Specify the length of time (in minutes) that the token can be refreshed - | within. I.E. The user can refresh their token within a 2 week window of - | the original token being created until they must re-authenticate. - | Defaults to 2 weeks - | - */ - - 'refresh_ttl' => 20160, - - /* - |-------------------------------------------------------------------------- - | JWT hashing algorithm - |-------------------------------------------------------------------------- - | - | Specify the hashing algorithm that will be used to sign the token. - | - | See here: https://github.com/namshi/jose/tree/2.2.0/src/Namshi/JOSE/Signer - | for possible values - | - */ - - 'algo' => 'HS256', - - /* - |-------------------------------------------------------------------------- - | User Model namespace - |-------------------------------------------------------------------------- - | - | Specify the full namespace to your User model. - | e.g. 'Acme\Entities\User' - | - */ - - 'user' => 'Pterodactyl\Models\User', - - /* - |-------------------------------------------------------------------------- - | User identifier - |-------------------------------------------------------------------------- - | - | Specify a unique property of the user that will be added as the 'sub' - | claim of the token payload. - | - */ - - 'identifier' => 'id', - - /* - |-------------------------------------------------------------------------- - | Required Claims - |-------------------------------------------------------------------------- - | - | Specify the required claims that must exist in any token. - | A TokenInvalidException will be thrown if any of these claims are not - | present in the payload. - | - */ - - 'required_claims' => ['iss', 'iat', 'exp', 'nbf', 'sub', 'jti'], - - /* - |-------------------------------------------------------------------------- - | Blacklist Enabled - |-------------------------------------------------------------------------- - | - | In order to invalidate tokens, you must have the the blacklist enabled. - | If you do not want or need this functionality, then set this to false. - | - */ - - 'blacklist_enabled' => env('JWT_BLACKLIST_ENABLED', true), - - /* - |-------------------------------------------------------------------------- - | Providers - |-------------------------------------------------------------------------- - | - | Specify the various providers used throughout the package. - | - */ - - 'providers' => [ - - /* - |-------------------------------------------------------------------------- - | User Provider - |-------------------------------------------------------------------------- - | - | Specify the provider that is used to find the user based - | on the subject claim - | - */ - - 'user' => 'Tymon\JWTAuth\Providers\User\EloquentUserAdapter', - - /* - |-------------------------------------------------------------------------- - | JWT Provider - |-------------------------------------------------------------------------- - | - | Specify the provider that is used to create and decode the tokens. - | - */ - - 'jwt' => 'Tymon\JWTAuth\Providers\JWT\NamshiAdapter', - - /* - |-------------------------------------------------------------------------- - | Authentication Provider - |-------------------------------------------------------------------------- - | - | Specify the provider that is used to authenticate users. - | - */ - - 'auth' => function ($app) { - return new Tymon\JWTAuth\Providers\Auth\IlluminateAuthAdapter($app['auth']); - }, - - /* - |-------------------------------------------------------------------------- - | Storage Provider - |-------------------------------------------------------------------------- - | - | Specify the provider that is used to store tokens in the blacklist - | - */ - - 'storage' => function ($app) { - return new Tymon\JWTAuth\Providers\Storage\IlluminateCacheAdapter($app['cache']); - } - - ] - -];