yuanzhihai / webman-jwt-auth

Lcobucci/jwt JSON Web Token (JWT) for webman plugin
10 stars 3 forks source link

单点登录自动续签token #13

Closed yaoayo closed 1 year ago

yaoayo commented 1 year ago

验证token时候 Utils::isPast( $claims->get( 'exp' )->getTimestamp(),$leeway ) 这里始终返回 false 导致不能自动续签

yuanzhihai commented 1 year ago

验证token时候 Utils::isPast( $claims->get( 'exp' )->getTimestamp(),$leeway ) 这里始终返回 false 导致不能自动续签

过期了才返回 true

yaoayo commented 1 year ago

你可以试一下 这个自动续签 过期了也是false

yuanzhihai commented 1 year ago

你可以试一下 这个自动续签 过期了也是false

打印返回 true 啊

yaoayo commented 1 year ago

3.0.2 这个版本开启自动续签token 不生效并响应头没有返回续签token

yaoayo commented 1 year ago

这个我的配置

'expires_at' => 120, 'refresh_ttL' => 180, 'leeway' => 60, 'signer' => 'HS256', 'type' => 'Header', 'auto_refresh' => true,

yuanzhihai commented 1 year ago

我这个插件是从fpm的项目修改过来的
具体为什么没返回 ,应该是 response的问题

yuanzhihai commented 1 year ago

你如果有能力 提交一下pr

yaoayo commented 1 year ago

image 是这两个判断问题

yuanzhihai commented 1 year ago

不是 判断 看这个方法 $this->automaticRenewalToken();

yaoayo commented 1 year ago

image 把 验证token是否存在黑名单 判断移动到最下面 能解决问题

yaoayo commented 1 year ago

还需要在 hasTokenBlack 这个方法里面再处理一下 如果开启了自动刷新token 过期后不抛异常

yuanzhihai commented 1 year ago

已优化