Skip to content

Commit 207c22e

Browse files
authored
注销没有store参数的Token
1 parent f786554 commit 207c22e

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/Jwt.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,14 @@ protected function automaticRenewalToken(Token $token)
300300
*/
301301
protected function validateToken(Token $token)
302302
{
303+
$claims = $token->getClaims();
304+
305+
// 注销没有store参数的Token
306+
if (!is_set($claims['store'])) {
307+
$this->logout($token);
308+
throw new TokenAlreadyEexpired('此 Token 已注销,请重新登录', $this->getReloginCode());
309+
}
310+
303311
// 是否在黑名单
304312
if ($this->app['jwt.manager']->hasBlacklist($token)) {
305313
throw new TokenAlreadyEexpired('此 Token 已注销,请重新登录', $this->getReloginCode());

0 commit comments

Comments
 (0)