From 38153de7c66d6eceb819392531931928878d48ef Mon Sep 17 00:00:00 2001 From: weichien00 Date: Sat, 26 Jun 2021 03:45:56 +0800 Subject: [PATCH] update: JWT auth config. --- app/Http/Kernel.php | 3 ++- config/auth.php | 6 +++--- config/jwt.php | 3 +-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index f87766eb..79e670f6 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -2,6 +2,7 @@ namespace App\Http; +use App\Http\Middleware\ValidateToken; use Illuminate\Foundation\Http\Kernel as HttpKernel; class Kernel extends HttpKernel @@ -40,7 +41,7 @@ class Kernel extends HttpKernel ], 'api' => [ - 'throttle:api', + 'throttle:300,1', \Illuminate\Routing\Middleware\SubstituteBindings::class, ], ]; diff --git a/config/auth.php b/config/auth.php index ba1a4d8c..9a2c2632 100644 --- a/config/auth.php +++ b/config/auth.php @@ -14,7 +14,7 @@ return [ */ 'defaults' => [ - 'guard' => 'web', + 'guard' => 'api', 'passwords' => 'users', ], @@ -42,7 +42,7 @@ return [ ], 'api' => [ - 'driver' => 'token', + 'driver' => 'jwt', 'provider' => 'users', 'hash' => false, ], @@ -96,7 +96,7 @@ return [ 'users' => [ 'provider' => 'users', 'table' => 'password_resets', - 'expire' => 60, + 'expire' => 1440, 'throttle' => 60, ], ], diff --git a/config/jwt.php b/config/jwt.php index 8b7843b6..3c9b551b 100644 --- a/config/jwt.php +++ b/config/jwt.php @@ -170,8 +170,7 @@ return [ */ 'persistent_claims' => [ - // 'foo', - // 'bar', + 'name', 'email', 'type', 'company_id', 'status', 'verification' ], /*