From 0300311b74705c03e49f44ddee522ac4646beff1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E4=B8=9C=E4=BA=91?= Date: Thu, 18 Aug 2022 09:49:35 +0800 Subject: [PATCH] =?UTF-8?q?docs(allow.multi-device):=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Services/Sp/Assertion.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Services/Sp/Assertion.php b/src/Services/Sp/Assertion.php index 320eab2..a7e88e8 100644 --- a/src/Services/Sp/Assertion.php +++ b/src/Services/Sp/Assertion.php @@ -12,6 +12,7 @@ declare(strict_types=1); namespace Singularity\HyperfSaml\Services\Sp; use Exception; +use Hyperf\Contract\StdoutLoggerInterface; use Hyperf\HttpMessage\Cookie\Cookie; use Hyperf\HttpMessage\Stream\SwooleStream; use Hyperf\HttpServer\Contract\RequestInterface; @@ -46,6 +47,7 @@ class Assertion private ResponseInterface $response, private AuthenticationInterface $authentication, private Redis $redis, + private StdoutLoggerInterface $stdoutLogger ) { } @@ -106,11 +108,16 @@ class Assertion { // 记录映射 $key = "{$redis_prefix}user:token_map:{$user['uid']}"; + $this->stdoutLogger->info('allow multi device online: ' . $allow_multi_online); if (!$allow_multi_online) { // 顶掉之前已经登录的用户 $this->redis->del($key); + $this->stdoutLogger->info('删除现有记录'); + $this->stdoutLogger->info($this->redis->type($key)); } $this->redis->hSet($key, $user['originToken'], $token); + $this->stdoutLogger->info('更新后的现有记录'); + $this->stdoutLogger->info($this->redis->type($key)); } $url = config('saml.client.landing_host');