Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#34106 closed New feature (wontfix)

Allow LogoutView to render a confirmation template on a GET request (Like LoginView)

Reported by: Nick Mow Owned by: nobody
Component: contrib.auth Version: 4.1
Severity: Normal Keywords: logout, logoutview, formview
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: yes

Description

LoginView has a very reasonable workflow IMO. A GET request renders a template. Submitting the form produces a POST request, which then creates the user and issues a redirect.

LogoutView is currently undergoing a deprecation process for GET requests, which I believe is somewhat misguided. The idea to prevent logouts via GET request is a good one IMO. However, I think that the GET request should be preserved to render a "logout confirmation" template if desired (and perhaps bypassed with an boolean attribute like 'require_confirmation' or something of the sort).

If this is done, the desired behavior behind the changes (no logout via GET request) is preserved. It also leaves room for a "logout confirmation" template, which would harmonize the LogoutView behavior with that of the LoginView. If a user doesn't want any logout confirmation, they could set/unset the 'require_confirmation' boolean to easily get the desired behavior.

I think this strategy would dovetail well with some of the changes that have been made to LogoutView during the 4.x releases, ie. making the behavior of LogoutView more like any other FormView (e.g. renaming get_next_page() to get_success_url()). This would also reduce the cognitive burden of having to deal with unnecessarily (?) specialized view behavior.

Change History (5)

comment:1 by Nick Mow, 2 years ago

Summary: LogoutView should behave more like LoginViewAllow LogoutView to render a confirmation template on a GET request (Like LoginView)

comment:2 by David Sanders, 2 years ago

Type: Cleanup/optimizationNew feature

Hi Nick.

Just clarifying this is a feature request and will most likely be marked as wontfix until a proposal is discussed on the DevelopersMailingList where it'll reach a wider audience. Please see the guidelines for requesting features for more information. :)

in reply to:  2 comment:3 by Nick Mow, 2 years ago

Replying to David Sanders:

Hi Nick.

Just clarifying this is a feature request and will most likely be marked as wontfix until a proposal is discussed on the DevelopersMailingList where it'll reach a wider audience. Please see the guidelines for requesting features for more information. :)

OK, I will look into that. Thank you for the quick reply!

comment:4 by David Sanders, 2 years ago

Resolution: wontfix
Status: newclosed

Marking wontfix pending discussion outcomes. Feel free to reopen the ticket if the feature request is accepted by the Django community.

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