-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Add setting to hide the intermediary logout page #1922
base: master
Are you sure you want to change the base?
Add setting to hide the intermediary logout page #1922
Conversation
from django.conf import settings | ||
|
||
|
||
def exposed_settings(request): |
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.
def exposed_settings(request): | |
def expose_settings(request): |
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.
Sorry for the long lead time. This has now been addressed
7080d58
to
f872b4f
Compare
I have been searching for a solution for this... I am merging this to my project now. |
{# Hide form - prevents user confusion by seeing an auto-submitting form #} | ||
<script>document.getElementsByClassName('container')[0].style.display = 'none';</script> | ||
{% endif %} | ||
|
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.
The document might have multiple container
so if there is another container (e.g. in the header) this script will fail. I would suggest wrapping the form in a div
<div style='display:none'>
<form ...> </form>
</div>
instead.
{# Hide form - prevents user confusion by seeing an auto-submitting form #} | ||
<script>document.getElementsByClassName('container')[0].style.display = 'none';</script> | ||
{% endif %} | ||
|
||
<h1>{% trans "Sign Out" %}</h1> |
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.
If you indeed use a display:none
div
, this can be left out of the div
and becomes something like
<h1>{% trans "Signing Out" %}</h1>
so that users can see a Sinning Out
message instead of a blank page.
Description
I would like to avoid showing the unnecessary, intermediary confirmation signout page.
The need for an intermediary page is documented in the
django-allauth
docs: https://django-allauth.readthedocs.io/en/latest/views.html#logout-account-logoutThis change will still use the intermediary logout page, but instead auto-submit the form via JavaScript. This has the added benefit of still degrading to using the form in the case that JavaScript is disabled.
The concept comes from an old Django issue: https://code.djangoproject.com/ticket/15619#comment:38
Rationale
This is something that I believe would benefit the larger community. It's an optional feature with the default value ensuring that it does not change the expected behavior.
Use case(s) / visualization(s)
This hides an unnecessary, intermediary page and increases user UX by preventing clicks where not necessary.