diff --git a/.env.example b/.env.example index 4608c185b2..6e41e009df 100644 --- a/.env.example +++ b/.env.example @@ -76,6 +76,7 @@ ENCRYPT=false COOKIE_NAME=snipeit_session COOKIE_DOMAIN=null SECURE_COOKIES=false +API_TOKEN_EXPIRATION_YEARS=40 # -------------------------------------------- # OPTIONAL: SECURITY HEADER SETTINGS diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php index efdbec0c08..067af8ccb0 100644 --- a/app/Providers/AuthServiceProvider.php +++ b/app/Providers/AuthServiceProvider.php @@ -87,9 +87,9 @@ class AuthServiceProvider extends ServiceProvider $this->registerPolicies(); Passport::routes(); - Passport::tokensExpireIn(Carbon::now()->addYears(20)); - Passport::refreshTokensExpireIn(Carbon::now()->addYears(20)); - Passport::personalAccessTokensExpireIn(Carbon::now()->addYears(20)); + Passport::tokensExpireIn(Carbon::now()->addYears(config('passport.expiration_years'))); + Passport::refreshTokensExpireIn(Carbon::now()->addYears(config('passport.expiration_years'))); + Passport::personalAccessTokensExpireIn(Carbon::now()->addYears(config('passport.expiration_years'))); Passport::withCookieSerialization(); diff --git a/config/passport.php b/config/passport.php index 1d9244514a..b8342a6b59 100644 --- a/config/passport.php +++ b/config/passport.php @@ -12,4 +12,5 @@ return [ */ 'private_key' => env('PASSPORT_PRIVATE_KEY'), 'public_key' => env('PASSPORT_PUBLIC_KEY'), + 'expiration_years' => env('API_TOKEN_EXPIRATION_YEARS', 20), ]; \ No newline at end of file diff --git a/public/js/build/app.js b/public/js/build/app.js index dfb6601a0d..b29082883d 100644 Binary files a/public/js/build/app.js and b/public/js/build/app.js differ diff --git a/public/js/dist/all.js b/public/js/dist/all.js index c84e7fb52f..1aeb7d4b2d 100644 Binary files a/public/js/dist/all.js and b/public/js/dist/all.js differ diff --git a/public/mix-manifest.json b/public/mix-manifest.json index d4c58a6d79..80926ec617 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -1,5 +1,5 @@ { - "/js/build/app.js": "/js/build/app.js?id=2f6c6e40a6009d5d0066", + "/js/build/app.js": "/js/build/app.js?id=df0e9d334d5c0b0eb048", "/css/build/AdminLTE.css": "/css/build/AdminLTE.css?id=59413334823616b81341", "/css/build/app.css": "/css/build/app.css?id=032fd8c3fce99c7fd862", "/css/build/overrides.css": "/css/build/overrides.css?id=0b4aefd7ef0c117ef23a", @@ -34,5 +34,5 @@ "/css/dist/bootstrap-table.css": "/css/dist/bootstrap-table.css?id=1e77fde04b3f42432581", "/js/build/vendor.js": "/js/build/vendor.js?id=aff75d5aad5e7b429723", "/js/dist/bootstrap-table.js": "/js/dist/bootstrap-table.js?id=58d95c93430f2ae33392", - "/js/dist/all.js": "/js/dist/all.js?id=f9ad3790a16ec5348bff" + "/js/dist/all.js": "/js/dist/all.js?id=5dc677546cc6d86e605d" } diff --git a/resources/assets/js/components/passport/PersonalAccessTokens.vue b/resources/assets/js/components/passport/PersonalAccessTokens.vue index d825df0b31..aff75c36da 100644 --- a/resources/assets/js/components/passport/PersonalAccessTokens.vue +++ b/resources/assets/js/components/passport/PersonalAccessTokens.vue @@ -46,11 +46,11 @@ - {{ token.expires_at }} + {{ token.created_at }} - {{ token.created_at }} + {{ token.expires_at }}