From 3619e10b74e64eb11c054491568533fa858e9f7e Mon Sep 17 00:00:00 2001 From: Gijs Straathof Date: Wed, 30 Jun 2021 21:56:48 +0200 Subject: [PATCH 1/3] Clear cookie with samesite=none --- src/Security/Guard/JWTTokenAuthenticator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Security/Guard/JWTTokenAuthenticator.php b/src/Security/Guard/JWTTokenAuthenticator.php index 73feebd..8606c7c 100644 --- a/src/Security/Guard/JWTTokenAuthenticator.php +++ b/src/Security/Guard/JWTTokenAuthenticator.php @@ -57,7 +57,7 @@ public function onAuthenticationFailure(Request $request, AuthenticationExceptio $response = parent::onAuthenticationFailure($request, $authException); // TODO: Change the autogenerated stub if ($authException instanceof InvalidTokenException || $authException instanceof ExpiredTokenException) { - $response->headers->clearCookie('BEARER'); + $response->headers->clearCookie('BEARER', '/', null, false, true, 'none'); } return $response; From b4502191dc12a1db8d86991263c12b4c03d85aa0 Mon Sep 17 00:00:00 2001 From: Gijs Straathof Date: Thu, 1 Jul 2021 15:17:33 +0200 Subject: [PATCH 2/3] set secure=true for clearCookie --- src/Security/Guard/JWTTokenAuthenticator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Security/Guard/JWTTokenAuthenticator.php b/src/Security/Guard/JWTTokenAuthenticator.php index 8606c7c..74e53b9 100644 --- a/src/Security/Guard/JWTTokenAuthenticator.php +++ b/src/Security/Guard/JWTTokenAuthenticator.php @@ -57,7 +57,7 @@ public function onAuthenticationFailure(Request $request, AuthenticationExceptio $response = parent::onAuthenticationFailure($request, $authException); // TODO: Change the autogenerated stub if ($authException instanceof InvalidTokenException || $authException instanceof ExpiredTokenException) { - $response->headers->clearCookie('BEARER', '/', null, false, true, 'none'); + $response->headers->clearCookie('BEARER', '/', null, true, true, 'none'); } return $response; From 4e15e6a9e8ab6ec10150c0ed7f8f9aafaaf18127 Mon Sep 17 00:00:00 2001 From: Gijs Straathof Date: Sun, 4 Jul 2021 20:42:37 +0200 Subject: [PATCH 3/3] remove scrutinizer php compile options --- .scrutinizer.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.scrutinizer.yml b/.scrutinizer.yml index 593f95c..a5ffd26 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -5,7 +5,6 @@ build: environment: php: version: 7.4 - compile_options: '--with-config-file-path=/home/scrutinizer/.phpenv/versions/7.4.3/etc --with-config-file-scan-dir=/home/scrutinizer/.phpenv/versions/7.4.3/etc/conf.d --prefix=/home/scrutinizer/.phpenv/versions/7.4.3 --libexecdir=/home/scrutinizer/.phpenv/versions/7.4.3/libexec --enable-intl --with-openssl --without-pear --with-gd --enable-gd --with-jpeg-dir=/usr --with-png-dir=/usr --with-freetype-dir=/usr --enable-exif --with-libzip --with-zlib --with-zlib-dir=/usr --with-sodium --with-pdo-sqlite --enable-soap --enable-xmlreader --with-xsl --enable-ftp --with-tidy --with-xmlrpc --enable-sysvsem --enable-sysvshm --enable-sysvmsg --enable-shmop --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --enable-pcntl --with-readline --enable-mbstring --with-curl --with-pgsql --with-pdo-pgsql --with-gettext --enable-sockets --with-bz2 --enable-bcmath --enable-calendar --with-libdir=lib --enable-fpm --enable-maintainer-zts --with-gmp --with-kerberos --with-imap --with-imap-ssl --with-apxs2=/usr/bin/apxs --with-ldap --with-pear=/home/scrutinizer/.phpenv/versions/7.4.3/pear' nodes: phpunit: