We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6436681 commit b9d16afCopy full SHA for b9d16af
1 file changed
src/Service/JwtAuth.php
@@ -80,6 +80,9 @@ public function verify(?string $token): bool
80
$token = $service->getRequestToken();
81
}
82
83
+ // 是否存在黑名单
84
+ $this->wasBan($token);
85
+
86
if (!$service->validate($token)) {
87
$now = new DateTimeImmutable();
88
@@ -96,13 +99,16 @@ public function verify(?string $token): bool
96
99
$token = $this->app->get('jwt.token')->getToken();
97
100
98
101
- // 是否存在黑名单
102
+ return true;
103
+ }
104
105
+ protected function wasBan($token)
106
+ {
107
+ $token = $this->app->get('jwt.token')->parse($token);
108
if (true === $this->app->get('jwt.manager')->wasBan($token)) {
109
$config = $this->app->get('jwt.token')->getConfig();
110
111
throw new TokenAlreadyEexpired('token was ban', $config->getReloginCode());
112
-
- return true;
113
114
0 commit comments