having same issue here pls help>
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 30/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- javascript
- 领域
- api, authentication
调研方向
从 issue 中所示的 frontend axios.post 调用以及处理 POST /auth/refresh-token 的 backend handler 开始。重现 400 响应,并追踪 endpoint 期望从 request body 还是从 cookie 获取 refresh token;当 refresh request 遵循一个有文档记录的契约并成功时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Yes Sir I watched it and thanks for uploading very good content. We are using httponly cookie to prevent xss. But My problem is that How can I send this httpOnly cookie through Post Request as Post Request needs Body otherwise it gives 400 error.
Here withCredentials is sending cookies i.e refresh-token but In my backend I am sending refresh token through requests body using post request.
Backend Request:
POST /auth/refresh-token HTTP/1.1
Host: localhost:3000
Content-Type: application/json
Content-Length: 225
{
"refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE2NDg1NTM0NDIsImV4cCI6MTY4MDExMTA0MiwiYXVkIjoiNjIwYzAyYTNlN2MyMWM0NzNhMjZmNGUxIiwiaXNzIjoic29jaWFsLmNvbSJ9.iQiSGutds1ZPrwrJi2lx0UOGUB4Ed6OQdUQAskq3BR0"
}
I Tried:
const refresh= async()=>{
const response= await axios.post("/auth/refresh-token",{
headers:{'Content-Type': 'application/json'},
withCredentials:true
});
And it is giving 400 error as expected.
How can I send refresh token to this post request?
Originally posted by @Traitor00 in https://github.com/gitdagray/react_jwt_auth/issues/1#issuecomment-1082868387
- 主要语言
- JavaScript
- 星标
- 515
- 派生
- 216
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
gitdagray/react_jwt_auth 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 35/100
gitdagray/react_jwt_auth#12 ·
-
难度 3/5 1-2 天 新手友好度 30/100
gitdagray/react_jwt_auth#11 · 1 条评论 · 1 个 reaction ·
-
难度 3/5 1-2 天 新手友好度 35/100
-
难度 2/5 1-3 小时 新手友好度 45/100
gitdagray/react_jwt_auth#8 · 2 条评论 ·
-
难度 3/5 1-2 天 新手友好度 30/100
查看 gitdagray/react_jwt_auth 的全部 Issue
相似的 Issue
-
channels:add check:passed
难度 1/5 1 小时以内 新手友好度 72/100
维护者通常 9 天内回复
-
documentation
难度 1/5 1 小时以内 新手友好度 88/100
githubnext/gh-aw-workshop#4496 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
swc-project/swc#12516 ·
维护者通常 1 天内回复
-
Opening Files on a demo drive logs you out可能已有人在做 @RChang06 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 2 天内回复
-
feature-request
难度 2/5 1-3 小时 新手友好度 72/100
omegaup/omegaup#10323 · 1 条评论 ·
维护者通常 5 天内回复