Skip to content

Commit

Permalink
feat:刷新令牌异常JwtRefreshTokenExpiredException
Browse files Browse the repository at this point in the history
  • Loading branch information
Tinywan committed Nov 3, 2022
1 parent e55f2a7 commit 25bd23d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/JwtToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,15 @@ public static function refreshToken(): array
try {
$extend = self::verifyToken($token, self::REFRESH_TOKEN);
} catch (SignatureInvalidException $signatureInvalidException) {
throw new JwtTokenException('刷新令牌无效');
throw new JwtRefreshTokenExpiredException('刷新令牌无效');
} catch (BeforeValidException $beforeValidException) {
throw new JwtTokenException('刷新令牌尚未生效');
throw new JwtRefreshTokenExpiredException('刷新令牌尚未生效');
} catch (ExpiredException $expiredException) {
throw new JwtRefreshTokenExpiredException('刷新令牌会话已过期,请再次登录!');
} catch (UnexpectedValueException $unexpectedValueException) {
throw new JwtTokenException('刷新令牌获取的扩展字段不存在');
throw new JwtRefreshTokenExpiredException('刷新令牌获取的扩展字段不存在');
} catch (JwtCacheTokenException | \Exception $exception) {
throw new JwtTokenException($exception->getMessage());
throw new JwtRefreshTokenExpiredException($exception->getMessage());
}
$payload = self::generatePayload($config, $extend['extend']);
$secretKey = self::getPrivateKey($config);
Expand Down

0 comments on commit 25bd23d

Please sign in to comment.