Add setting to hide the intermediary logout page#1922
Open
wgordon17 wants to merge 1 commit into
Open
Conversation
KrunchMuffin
reviewed
Feb 2, 2019
| from django.conf import settings | ||
|
|
||
|
|
||
| def exposed_settings(request): |
There was a problem hiding this comment.
Suggested change
| def exposed_settings(request): | |
| def expose_settings(request): |
Contributor
Author
There was a problem hiding this comment.
Sorry for the long lead time. This has now been addressed
7080d58 to
f872b4f
Compare
Contributor
|
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.
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.
| <script>document.getElementsByClassName('container')[0].style.display = 'none';</script> | ||
| {% endif %} | ||
|
|
||
| <h1>{% trans "Sign Out" %}</h1> |
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
I would like to avoid showing the unnecessary, intermediary confirmation signout page.
The need for an intermediary page is documented in the
django-allauthdocs: 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.