Logout accepts GET requests

Ouverte
#6,403 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
67/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
Active
Stack technique
django, javascript, python

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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.

Langage dominant
Python
Étoiles
212
Forks
321
Merge moyen
1 j 7 h
PR mergées (30 j)
14

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de learningequality/studio

Toutes les issues de learningequality/studio

Issues similaires

Plus d'issues Python

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.