Skip to content

Commit b9d16af

Browse files
committed
update
1 parent 6436681 commit b9d16af

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

src/Service/JwtAuth.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ public function verify(?string $token): bool
8080
$token = $service->getRequestToken();
8181
}
8282

83+
// 是否存在黑名单
84+
$this->wasBan($token);
85+
8386
if (!$service->validate($token)) {
8487
$now = new DateTimeImmutable();
8588

@@ -96,13 +99,16 @@ public function verify(?string $token): bool
9699
$token = $this->app->get('jwt.token')->getToken();
97100
}
98101

99-
// 是否存在黑名单
102+
return true;
103+
}
104+
105+
protected function wasBan($token)
106+
{
107+
$token = $this->app->get('jwt.token')->parse($token);
100108
if (true === $this->app->get('jwt.manager')->wasBan($token)) {
101109
$config = $this->app->get('jwt.token')->getConfig();
102110

103111
throw new TokenAlreadyEexpired('token was ban', $config->getReloginCode());
104112
}
105-
106-
return true;
107113
}
108114
}

0 commit comments

Comments
 (0)