-
Notifications
You must be signed in to change notification settings - Fork 633
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix logout in Django 5 with POST action instead of GET #1181
Conversation
helpdesk/urls.py
Outdated
@@ -215,7 +215,7 @@ def get_context_data(self, **kwargs): | |||
path( | |||
"logout/", | |||
auth_views.LogoutView.as_view( | |||
template_name="helpdesk/registration/login.html", next_page="../" | |||
template_name="helpdesk/registration/login.html", next_page=reverse_lazy("helpdesk:home") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that the template_name
does not seem to be useful when we provide next_page
.
Moreover, there is a template for the confirmation of logging out, but it's not called anywhere. I believe it would make more sense to point to it instead of login page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed - go ahead and change the logout next page to the confirmation of logout page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally the logged out page needs a link to go back to the login page otherwise the user who is security concious and logs out regularly has to change the URL or use a bookmark.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Awesome - much better flow |
Fixes #1174
Uses technique from https://learndjango.com/tutorials/django-login-and-logout-tutorial#log-out-button