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 token 需要在认证 header 里加上类型: Bearer #774

Closed
canstand opened this issue Jun 17, 2021 · 1 comment
Closed

jwt token 需要在认证 header 里加上类型: Bearer #774

canstand opened this issue Jun 17, 2021 · 1 comment

Comments

@canstand
Copy link

Describe the bug

目前的请求拦截器 requestInterceptors 中 getToken 取得的 token ,设置为 Authorization header 时前面没有加上认证方案类型。
Authorization: <type> <credentials>

对于 JWT,类型应该是 Bearer,参考 MDN
Authorization: Bearer <token>

建议在 projectSettings.ts 里加一个 authScheme: 'Bearer' 的配置,可以根据后台需要修改。

Reproduction

使用正确解析 Authorization 的接口测试,mock 接口当前没做验证。

@anncwb anncwb closed this as completed in b6d5b07 Jun 17, 2021
@anncwb
Copy link
Collaborator

anncwb commented Jun 17, 2021

新增了选项,可以自行配置
image

@github-actions github-actions bot locked and limited conversation to collaborators Sep 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants