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

CommonJwtAuthMiddleware使用 #123

Closed
a95241815 opened this issue Jul 5, 2023 · 2 comments
Closed

CommonJwtAuthMiddleware使用 #123

a95241815 opened this issue Jul 5, 2023 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@a95241815
Copy link

我看项目里有CommonJwtAuthMiddleware的中间件,但没有用上,我使用了示例的jwt进行认证,想从header中解密出用户id放到上下文中,请问有这方面的示例吗

@Mikaelemmmm
Copy link
Owner

这个如果想用的话直接 当作middleware使用即可,就不需要使用zero默认的jwt了。
这个中间件是为了处理一种场景:
有的接口不等登陆的时候给用户返回推荐列表,如果用户登陆的话就拿用户自己的列表数据。zero默认的jwt 就是如果你配置了jwt,那么token必须通过,就无法满足这个场景

@Mikaelemmmm Mikaelemmmm added the help wanted Extra attention is needed label Jul 5, 2023
@a95241815
Copy link
Author

好的,感谢解答

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants