Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

建议将jwt和你的api拆分开,还有缺少刷新接口,以及刷新过期时间? #37

Open
admininfon opened this issue Nov 16, 2019 · 0 comments

Comments

@admininfon
Copy link

我看了 laravel-jwt 的组件,自己也封装的扩展类,添加了黑名单机制;思路就是通过刷新过期时间判断token的刷新状态,过期则重新登录;刷新成功将过期token放入黑名单,不放入黑名单的话,刷新时间未过期则会出现旧token成功换取到N个新token,token的黑名单采用的cache缓存,缓存时间是token刷新时间的秒数,如果空值精确一些,可以将时间计算到token失效刷新时间的时间戳,为了保证token失效,最好多保存一些时间,以确保token的刷新时间小于当前系统时间,并且该token在缓存内已经剔除,token刷新成功后,旧的token刷新时间还在有效期时,请确保黑名单能查询到即可,旧的token刷新时间失效,黑名单就可以删除了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant