Logout accepts GET requests
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 67/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- django, javascript, python
调研方向
Read contentcuration/contentcuration/views/users.py and the logout action in contentcuration/contentcuration/frontend/shared/vuex/session/index.js; the issue gives the relevant entry points and expected behavior. Update backend and frontend tests to cover GET, POST with and without a CSRF token, direct logout() callers, and the sign-out flows. Done means GET is rejected, valid POST logs out, missing CSRF is rejected, and both app sign-out controls still work.
由索引模型根据 Issue 内容生成。
描述
Overview
/accounts/logout/ logs the user out on a GET request, which Django's CSRF protection doesn't check. Any page a Studio user visits can sign them out by loading that URL, for example as an image.
Complexity: Low
Target branch: hotfixes
Context
- The
logoutview, routed ataccounts/logout/, accepts any method. - The frontend
logoutaction calls it withclient.getin both of its branches. - Reproduced:
GET /en/accounts/logout/returns 200 and ends the session.
The Change
logoutshould accept only POST, with Django's CSRF check, and the frontend should call it with POST.
Acceptance Criteria
General
-
GET /en/accounts/logout/returns 405 and the session stays active. -
POST /en/accounts/logout/with a valid CSRF token ends the session, and without one returns 403. -
DeleteAccountViewandnew_user_redirect, which calllogout()directly, still end the session as before. - "Sign out" in the app bar and the navigation drawer still signs the user out, including after confirming the unsaved-changes prompt.
Testing
- Backend tests cover GET, POST with a CSRF token and POST without one.
- A frontend test asserts the
logoutaction sends a POST.
AI usage
I chose which audit findings belong in #6398 and set the access pattern. Claude Code found and reproduced this gap and drafted this issue.
- 主要语言
- Python
- 星标
- 212
- 派生
- 321
- 平均合并
- 1 天 7 小时
- 30 天内合并 PR
- 14
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
learningequality/studio 的其他 Issue
-
Community library status changes don't update `date_updated`可能已有人在做 @ArpitaSamanta10 今天认领。 未关闭community-contribution-in-progress DEV: backend good first issue help wanted
难度 2/5 1-3 小时 新手友好度 84/100
learningequality/studio#6414 · 8 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
DEV: backend
难度 2/5 1-3 小时 新手友好度 82/100
learningequality/studio#6410 ·
维护者通常 1 天内回复
-
DEV: backend
难度 2/5 1-3 小时 新手友好度 76/100
learningequality/studio#6409 ·
维护者通常 1 天内回复
-
DEV: backend
难度 2/5 1-3 小时 新手友好度 78/100
learningequality/studio#6407 ·
维护者通常 1 天内回复
-
Stripe webhook accepts events when no webhook secret is configured可能已有人在做 @adibmbrk 今天认领。 未关闭community-contribution-in-progress DEV: backend good first issue help wanted
难度 2/5 1-3 小时 新手友好度 78/100
learningequality/studio#6404 · 3 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
查看 learningequality/studio 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 2 天内回复
-
audit-reference-check
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
site-bug triage
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 77/100
canonical/paas-charm#407 · 1 条评论 ·
维护者通常 5 天内回复