#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 , 2 years ago
Summary: | LogoutView should behave more like LoginView → Allow LogoutView to render a confirmation template on a GET request (Like LoginView) |
---|
follow-up: 3 comment:2 by , 2 years ago
Type: | Cleanup/optimization → New feature |
---|
comment:3 by , 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 , 2 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Marking wontfix pending discussion outcomes. Feel free to reopen the ticket if the feature request is accepted by the Django community.
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. :)