From a78d5c14fe2cc283d53083a74fcee937c3a74c39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 8 Sep 2020 10:45:39 +0800 Subject: [PATCH] e --- System/Jwt/Jwt.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/System/Jwt/Jwt.php b/System/Jwt/Jwt.php index 1bc4e161..884d1856 100644 --- a/System/Jwt/Jwt.php +++ b/System/Jwt/Jwt.php @@ -5,9 +5,11 @@ namespace Snowflake\Jwt; use Exception; use HttpServer\Http\HttpHeaders; use Redis; +use Snowflake\Abstracts\Config; use Snowflake\Core\Str; use Snowflake\Exception\AuthException; use Snowflake\Abstracts\Component; +use Snowflake\Exception\ConfigException; use Snowflake\Snowflake; class Jwt extends Component @@ -65,6 +67,21 @@ mlAZUEjsoaT9vjvjGTxl3uCm0TX5KTgtSJIt2kA1tYVjQef+/iZTHxY= /** @var Jwt */ private static $instance; + + /** + * @throws ConfigException + */ + public function init() + { + if (!Config::has('ssl.public') || !Config::has('ssl.private')) { + return; + } + $this->public = Config::get('ssl.public', false, $this->public); + $this->private = Config::get('ssl.private', false, $this->private); + $this->timeout = Config::get('ssl.timeout', false, 7200); + } + + /** * @param string $publicKey */