Skip to content

Commit 15f31fd

Browse files
Merge branch '2.4.8-beta1-develop' into cia-bugfix-ce-20240712
2 parents 28dcd31 + 4ff8b0f commit 15f31fd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

app/code/Magento/JwtUserToken/Model/SecretBasedJwksFactory.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class SecretBasedJwksFactory
3535
public function __construct(DeploymentConfig $deploymentConfig, JwkFactory $jwkFactory)
3636
{
3737
$this->keys = preg_split('/\s+/s', trim((string)$deploymentConfig->get('crypt/key')));
38+
$this->keys = [end($this->keys)];
3839
//Making sure keys are large enough.
3940
foreach ($this->keys as &$key) {
4041
$key = str_pad($key, 2048, '&', STR_PAD_BOTH);
@@ -48,6 +49,8 @@ public function __construct(DeploymentConfig $deploymentConfig, JwkFactory $jwkF
4849
* @param string $algorithm
4950
* @return Jwk[]
5051
* @throws \InvalidArgumentException When algorithm is not recognized.
52+
*
53+
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
5154
*/
5255
public function createFor(string $algorithm): array
5356
{

0 commit comments

Comments
 (0)