mirror of
http://124.126.16.154:8888/singularity/hyperf-saml.git
synced 2026-01-15 02:05:05 +08:00
fix(authn): 修复不再被支持的 swoole 变量
This commit is contained in:
1671
composer.lock
generated
1671
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Sso.php@HyperfSaml
|
||||
*
|
||||
@@ -42,8 +43,7 @@ class Sso
|
||||
private readonly ResponseInterface $response,
|
||||
private readonly StdoutLoggerInterface $stdoutLogger,
|
||||
private readonly ?Redis $redis,
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
/**
|
||||
* 自动重定向获取用户登录状态
|
||||
@@ -133,7 +133,7 @@ class Sso
|
||||
try {
|
||||
$this->stdoutLogger->info('user_token redis type: ' . $type);
|
||||
switch ($type) {
|
||||
case SWOOLE_REDIS_TYPE_STRING:
|
||||
case 1:
|
||||
// 旧的值
|
||||
// 理论上只有刚切换的时候才会有此情况
|
||||
$last_token = $this->redis->get($key);
|
||||
@@ -141,7 +141,7 @@ class Sso
|
||||
throw new Exception(code: CommonErrorCode::AUTH_SESSION_CREATED_AT_ERROR);
|
||||
}
|
||||
break;
|
||||
case SWOOLE_REDIS_TYPE_HASH:
|
||||
case 5:
|
||||
$origin_token = $this->redis->hKeys($key);
|
||||
$this->stdoutLogger->info('user_token redis keys: ' . Json::encode($origin_token));
|
||||
$origin_token = array_pop($origin_token);
|
||||
@@ -153,7 +153,7 @@ class Sso
|
||||
throw new Exception(code: CommonErrorCode::AUTH_SESSION_CREATED_AT_ERROR);
|
||||
}
|
||||
break;
|
||||
case SWOOLE_REDIS_TYPE_NOT_FOUND:
|
||||
case 0:
|
||||
break;
|
||||
default:
|
||||
throw new \Exception(code: CommonErrorCode::SERVER_ERROR);
|
||||
|
||||
Reference in New Issue
Block a user