Skip to content

Commit db1565e

Browse files
committed
fix:refresh_disable
1 parent 44d704f commit db1565e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/JwtToken.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,11 @@ public static function generateToken(array $extend): array
155155
if ($config['is_single_device']) {
156156
$client = $extend['client'] ?? self::TOKEN_CLIENT_WEB;
157157
RedisHandler::generateToken($config['cache_token_pre'], (string)$client, (string)$extend['id'], $config['access_exp'], $token['access_token']);
158-
RedisHandler::generateToken($config["cache_refresh_token_pre"], (string)$client, (string)$extend['id'], $config['refresh_exp'], $token['refresh_token']);
158+
if (!isset($config['refresh_disable']) || (isset($config['refresh_disable']) && $config['refresh_disable'] === false)) {
159+
if (isset($config["cache_refresh_token_pre"])) {
160+
RedisHandler::generateToken($config["cache_refresh_token_pre"], (string)$client, (string)$extend['id'], $config['refresh_exp'], $token['refresh_token']);
161+
}
162+
}
159163
}
160164
return $token;
161165
}

0 commit comments

Comments
 (0)