Skip to content

Commit 3b126f4

Browse files
authored
fixed refresh token failed when token expired
fixed refresh token failed when token expired
1 parent 865db72 commit 3b126f4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Manager.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public function refresh(Token $token, bool $forceForever = false, array $customC
111111

112112
if ($this->blacklistEnabled) {
113113
// Invalidate old token
114-
$this->invalidate($token, $forceForever);
114+
$this->invalidate($token, $forceForever, true);
115115
}
116116

117117
$claims = array_merge($claims, $customClaims);
@@ -125,15 +125,15 @@ public function refresh(Token $token, bool $forceForever = false, array $customC
125125
*
126126
* @throws \HyperfExt\Jwt\Exceptions\JwtException
127127
*/
128-
public function invalidate(Token $token, bool $forceForever = false): bool
128+
public function invalidate(Token $token, bool $forceForever = false, bool $ignoreExpired = false): bool
129129
{
130130
if (! $this->blacklistEnabled) {
131131
throw new JwtException('You must have the blacklist enabled to invalidate a token.');
132132
}
133133

134134
return call_user_func(
135135
[$this->blacklist, $forceForever ? 'addForever' : 'add'],
136-
$this->decode($token, false)
136+
$this->decode($token, false, $ignoreExpired)
137137
);
138138
}
139139

0 commit comments

Comments
 (0)