From d6f0abf28da7b76883217a9bc4602660205743d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Wed, 11 Aug 2021 11:31:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- System/Jwt/Jwt.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/System/Jwt/Jwt.php b/System/Jwt/Jwt.php index 2e700479..b21a1f5f 100644 --- a/System/Jwt/Jwt.php +++ b/System/Jwt/Jwt.php @@ -4,11 +4,11 @@ declare(strict_types=1); namespace Kiri\Jwt; use Exception; -use Server\Constrict\Request; use Kiri\Abstracts\Component; use Kiri\Abstracts\Config; use Kiri\Core\Json; use Kiri\Exception\ConfigException; +use Server\Constrict\Request; /** @@ -62,7 +62,9 @@ class Jwt extends Component */ private function jwtHeader(): string { - return base64_encode(json_encode(['type' => 'openssl', 'encrypt' => $this->encrypt])); + $string = openssl_encrypt(json_encode(['type' => 'openssl', 'encrypt' => $this->encrypt]), + "seed-ecb", $this->key); + return urlencode(str_replace('=', '', $string)); }