diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/internals/deprecation.txt | 4 | ||||
| -rw-r--r-- | docs/releases/4.1.txt | 30 | ||||
| -rw-r--r-- | docs/topics/auth/default.txt | 14 |
3 files changed, 46 insertions, 2 deletions
diff --git a/docs/internals/deprecation.txt b/docs/internals/deprecation.txt index 2c85eafc85..31eb732297 100644 --- a/docs/internals/deprecation.txt +++ b/docs/internals/deprecation.txt @@ -90,6 +90,10 @@ details on these changes. * ``created=True`` will be required in the signature of ``RemoteUserBackend.configure_user()`` subclasses. +* Support for logging out via ``GET`` requests in the + ``django.contrib.auth.views.LogoutView`` and + ``django.contrib.auth.views.logout_then_login()`` will be removed. + .. _deprecation-removed-in-4.1: 4.1 diff --git a/docs/releases/4.1.txt b/docs/releases/4.1.txt index 39dd2faba9..c7159bd4f2 100644 --- a/docs/releases/4.1.txt +++ b/docs/releases/4.1.txt @@ -446,6 +446,36 @@ Miscellaneous Features deprecated in 4.1 ========================== +Log out via GET +--------------- + +Logging out via ``GET`` requests to the :py:class:`built-in logout view +<django.contrib.auth.views.LogoutView>` is deprecated. Use ``POST`` requests +instead. + +If you want to retain the user experience of an HTML link, you can use a form +that is styled to appear as a link: + +.. code-block:: html + + <form id="logout-form" method="post" action="{% url 'admin:logout' %}"> + {% csrf_token %} + <button type="submit">{% translate "Log out" %}</button> + </form> + +.. code-block:: css + + #logout-form { + display: inline; + } + #logout-form button { + background: none; + border: none; + cursor: pointer; + padding: 0; + text-decoration: underline; + } + Miscellaneous ------------- diff --git a/docs/topics/auth/default.txt b/docs/topics/auth/default.txt index bef1486cdd..3e319560fb 100644 --- a/docs/topics/auth/default.txt +++ b/docs/topics/auth/default.txt @@ -1160,7 +1160,12 @@ implementation details see :ref:`using-the-views`. .. class:: LogoutView - Logs a user out. + Logs a user out on ``POST`` requests. + + .. deprecated:: 4.1 + + Support for logging out on ``GET`` requests is deprecated and will be + removed in Django 5.0. **URL name:** ``logout`` @@ -1212,7 +1217,7 @@ implementation details see :ref:`using-the-views`. .. function:: logout_then_login(request, login_url=None) - Logs a user out, then redirects to the login page. + Logs a user out on ``POST`` requests, then redirects to the login page. **URL name:** No default URL provided @@ -1221,6 +1226,11 @@ implementation details see :ref:`using-the-views`. * ``login_url``: The URL of the login page to redirect to. Defaults to :setting:`settings.LOGIN_URL <LOGIN_URL>` if not supplied. + .. deprecated:: 4.1 + + Support for logging out on ``GET`` requests is deprecated and will be + removed in Django 5.0. + .. class:: PasswordChangeView **URL name:** ``password_change`` |
