Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#28513 closed Bug (fixed)

LogoutView doesn't support POST, unlike the function-based logout() view

Reported by: Paulo Owned by: shangdahao
Component: contrib.auth Version: 1.11
Severity: Release blocker Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Tim Graham)

The function-based logout() view allows using a POST request.

Because the new LogoutView introduced in 78963495d0caadb77eb97ccf319ef0ba3b204fb5 doesn't define a post() method, a POST request returns "405 Method not allowed". I don't think POST was officially supported (don't see it in the docs) but there's code in the view that checks for the redirect field in the POST data.

Change History (6)

comment:1 Changed 3 years ago by Tim Graham

Component: Uncategorizedcontrib.auth
Description: modified (diff)
Severity: NormalRelease blocker
Summary: django 1.11 doesn't support POST for logout viewLogoutView doesn't support POST, unlike the function-based logout() view
Triage Stage: UnreviewedAccepted
Type: UncategorizedBug

It seems reasonable to support that.

comment:2 Changed 3 years ago by shangdahao

Owner: changed from nobody to shangdahao
Status: newassigned

comment:3 Changed 3 years ago by shangdahao

Has patch: set
Last edited 3 years ago by shangdahao (previous) (diff)

comment:4 Changed 3 years ago by Tim Graham

Triage Stage: AcceptedReady for checkin

comment:5 Changed 3 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: assignedclosed

In c0f4c60e:

Fixed #28513 -- Added POST request support to LogoutView.

comment:6 Changed 3 years ago by Tim Graham <timograham@…>

In 58aaf13e:

[1.11.x] Fixed #28513 -- Added POST request support to LogoutView.

Backport of c0f4c60edd429f5ef57241cfabd159d13e26e5ac from master

Note: See TracTickets for help on using tickets.
Back to Top