Merge pull request #15136 from snipe/fixes/cookie_serialization

Remove cookie serialization
This commit is contained in:
snipe 2024-07-23 21:41:44 +01:00 committed by GitHub
commit 00ebc8b64d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 5 additions and 3 deletions

View file

@ -87,6 +87,7 @@ SESSION_LIFETIME=12000
EXPIRE_ON_CLOSE=false EXPIRE_ON_CLOSE=false
ENCRYPT=false ENCRYPT=false
COOKIE_NAME=snipeit_session COOKIE_NAME=snipeit_session
PASSPORT_COOKIE_NAME='snipeit_passport_token'
COOKIE_DOMAIN=null COOKIE_DOMAIN=null
SECURE_COOKIES=false SECURE_COOKIES=false
API_TOKEN_EXPIRATION_YEARS=15 API_TOKEN_EXPIRATION_YEARS=15

View file

@ -20,5 +20,5 @@ class EncryptCookies extends BaseEncrypter
* *
* @var bool * @var bool
*/ */
protected static $serialize = true; protected static $serialize = false;
} }

View file

@ -87,11 +87,11 @@ class AuthServiceProvider extends ServiceProvider
]); ]);
$this->registerPolicies(); $this->registerPolicies();
//Passport::routes(); //this is no longer required in newer passport versions
Passport::tokensExpireIn(Carbon::now()->addYears(config('passport.expiration_years'))); Passport::tokensExpireIn(Carbon::now()->addYears(config('passport.expiration_years')));
Passport::refreshTokensExpireIn(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::personalAccessTokensExpireIn(Carbon::now()->addYears(config('passport.expiration_years')));
Passport::withCookieSerialization();
Passport::cookie(config('passport.cookie_name'));
/** /**

View file

@ -14,4 +14,5 @@ return [
'private_key' => env('PASSPORT_PRIVATE_KEY'), 'private_key' => env('PASSPORT_PRIVATE_KEY'),
'public_key' => env('PASSPORT_PUBLIC_KEY'), 'public_key' => env('PASSPORT_PUBLIC_KEY'),
'expiration_years' => env('API_TOKEN_EXPIRATION_YEARS', 20), 'expiration_years' => env('API_TOKEN_EXPIRATION_YEARS', 20),
'cookie_name' => env('PASSPORT_COOKIE_NAME', 'snipeit_passport_token'),
]; ];