plain.auth 0.11.0__tar.gz → 0.12.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {plain_auth-0.11.0 → plain_auth-0.12.0}/PKG-INFO +1 -1
- {plain_auth-0.11.0 → plain_auth-0.12.0}/plain/auth/sessions.py +14 -0
- {plain_auth-0.11.0 → plain_auth-0.12.0}/pyproject.toml +1 -1
- {plain_auth-0.11.0 → plain_auth-0.12.0}/.gitignore +0 -0
- {plain_auth-0.11.0 → plain_auth-0.12.0}/LICENSE +0 -0
- {plain_auth-0.11.0 → plain_auth-0.12.0}/README.md +0 -0
- {plain_auth-0.11.0 → plain_auth-0.12.0}/plain/auth/README.md +0 -0
- {plain_auth-0.11.0 → plain_auth-0.12.0}/plain/auth/__init__.py +0 -0
- {plain_auth-0.11.0 → plain_auth-0.12.0}/plain/auth/default_settings.py +0 -0
- {plain_auth-0.11.0 → plain_auth-0.12.0}/plain/auth/middleware.py +0 -0
- {plain_auth-0.11.0 → plain_auth-0.12.0}/plain/auth/utils.py +0 -0
- {plain_auth-0.11.0 → plain_auth-0.12.0}/plain/auth/views.py +0 -0
|
@@ -21,6 +21,20 @@ def get_session_auth_hash(user):
|
|
|
21
21
|
return _get_session_auth_hash(user)
|
|
22
22
|
|
|
23
23
|
|
|
24
|
+
def update_session_auth_hash(request, user):
|
|
25
|
+
"""
|
|
26
|
+
Updating a user's password (for example) logs out all sessions for the user.
|
|
27
|
+
|
|
28
|
+
Take the current request and the updated user object from which the new
|
|
29
|
+
session hash will be derived and update the session hash appropriately to
|
|
30
|
+
prevent a password change from logging out the session from which the
|
|
31
|
+
password was changed.
|
|
32
|
+
"""
|
|
33
|
+
request.session.cycle_key()
|
|
34
|
+
if request.user == user:
|
|
35
|
+
request.session[USER_HASH_SESSION_KEY] = get_session_auth_hash(user)
|
|
36
|
+
|
|
37
|
+
|
|
24
38
|
def get_session_auth_fallback_hash(user):
|
|
25
39
|
for fallback_secret in settings.SECRET_KEY_FALLBACKS:
|
|
26
40
|
yield _get_session_auth_hash(user, secret=fallback_secret)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|