Logout accepts GET requests

Aberta
#6,403 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
67/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
django, javascript, python

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

DEV: backend DEV: frontend

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 Change
  • logout should 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.
  • DeleteAccountView and new_user_redirect, which call logout() 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 logout action 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.

Linguagem predominante
Python
Estrelas
212
Forks
321
Merge médio
1d 7h
PRs com merge (30d)
14

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de learningequality/studio

Todas as issues de learningequality/studio

Issues semelhantes

Mais issues de Python

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.