diff --git a/src/Token.php b/src/Token.php index de125e9e..23c7e761 100644 --- a/src/Token.php +++ b/src/Token.php @@ -254,7 +254,7 @@ public function validate( ?int $tokenLeeway = null, ?int $tokenNow = null, ): self { - $tenantDomain = $this->configuration->formatDomain(true) . "/"; + $tenantDomain = $this->configuration->formatDomain(true) . '/'; $tokenIssuer ??= $this->configuration->formatDomain() . '/'; $tokenAudience ??= $this->configuration->getAudience() ?? []; $tokenOrganization ??= $this->configuration->getOrganization() ?? null; @@ -279,9 +279,10 @@ public function validate( try { $validator->issuer($tokenIssuer); } catch (InvalidTokenException $invalidTokenException) { - if($tenantDomain !== $tokenIssuer) { + if ($tenantDomain !== $tokenIssuer) { $validator->issuer($tenantDomain); } + throw $invalidTokenException; }