dj-jwt-auth 1.5.12__tar.gz → 1.6.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.
Files changed (28) hide show
  1. {dj-jwt-auth-1.5.12 → dj-jwt-auth-1.6.0}/PKG-INFO +1 -1
  2. {dj-jwt-auth-1.5.12 → dj-jwt-auth-1.6.0}/dj_jwt_auth.egg-info/PKG-INFO +1 -1
  3. {dj-jwt-auth-1.5.12 → dj-jwt-auth-1.6.0}/django_jwt/middleware.py +0 -3
  4. {dj-jwt-auth-1.5.12 → dj-jwt-auth-1.6.0}/django_jwt/user.py +4 -4
  5. {dj-jwt-auth-1.5.12 → dj-jwt-auth-1.6.0}/setup.cfg +1 -1
  6. {dj-jwt-auth-1.5.12 → dj-jwt-auth-1.6.0}/tests/test.py +2 -2
  7. {dj-jwt-auth-1.5.12 → dj-jwt-auth-1.6.0}/MANIFEST.in +0 -0
  8. {dj-jwt-auth-1.5.12 → dj-jwt-auth-1.6.0}/README.md +0 -0
  9. {dj-jwt-auth-1.5.12 → dj-jwt-auth-1.6.0}/dj_jwt_auth.egg-info/SOURCES.txt +0 -0
  10. {dj-jwt-auth-1.5.12 → dj-jwt-auth-1.6.0}/dj_jwt_auth.egg-info/dependency_links.txt +0 -0
  11. {dj-jwt-auth-1.5.12 → dj-jwt-auth-1.6.0}/dj_jwt_auth.egg-info/requires.txt +0 -0
  12. {dj-jwt-auth-1.5.12 → dj-jwt-auth-1.6.0}/dj_jwt_auth.egg-info/top_level.txt +0 -0
  13. {dj-jwt-auth-1.5.12 → dj-jwt-auth-1.6.0}/django_jwt/__init__.py +0 -0
  14. {dj-jwt-auth-1.5.12 → dj-jwt-auth-1.6.0}/django_jwt/config.py +0 -0
  15. {dj-jwt-auth-1.5.12 → dj-jwt-auth-1.6.0}/django_jwt/exceptions.py +0 -0
  16. {dj-jwt-auth-1.5.12 → dj-jwt-auth-1.6.0}/django_jwt/pkce.py +0 -0
  17. {dj-jwt-auth-1.5.12 → dj-jwt-auth-1.6.0}/django_jwt/roles.py +0 -0
  18. {dj-jwt-auth-1.5.12 → dj-jwt-auth-1.6.0}/django_jwt/settings.py +0 -0
  19. {dj-jwt-auth-1.5.12 → dj-jwt-auth-1.6.0}/django_jwt/templates/admin/login.html +0 -0
  20. {dj-jwt-auth-1.5.12 → dj-jwt-auth-1.6.0}/django_jwt/templates/django-jwt-index.html +0 -0
  21. {dj-jwt-auth-1.5.12 → dj-jwt-auth-1.6.0}/django_jwt/urls.py +0 -0
  22. {dj-jwt-auth-1.5.12 → dj-jwt-auth-1.6.0}/django_jwt/utils.py +0 -0
  23. {dj-jwt-auth-1.5.12 → dj-jwt-auth-1.6.0}/django_jwt/views.py +0 -0
  24. {dj-jwt-auth-1.5.12 → dj-jwt-auth-1.6.0}/pyproject.toml +0 -0
  25. {dj-jwt-auth-1.5.12 → dj-jwt-auth-1.6.0}/setup.py +0 -0
  26. {dj-jwt-auth-1.5.12 → dj-jwt-auth-1.6.0}/tests/__init__.py +0 -0
  27. {dj-jwt-auth-1.5.12 → dj-jwt-auth-1.6.0}/tests/models.py +0 -0
  28. {dj-jwt-auth-1.5.12 → dj-jwt-auth-1.6.0}/tests/urls.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dj-jwt-auth
3
- Version: 1.5.12
3
+ Version: 1.6.0
4
4
  Summary: A Django package for JSON Web Token validation and verification. Using PyJWT.
5
5
  Home-page: https://www.example.com/
6
6
  Author: Konstantin Seleznev
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dj-jwt-auth
3
- Version: 1.5.12
3
+ Version: 1.6.0
4
4
  Summary: A Django package for JSON Web Token validation and verification. Using PyJWT.
5
5
  Home-page: https://www.example.com/
6
6
  Author: Konstantin Seleznev
@@ -31,6 +31,3 @@ class JWTAuthMiddleware(MiddlewareMixin):
31
31
  return JsonResponse(status=HTTPStatus.UNAUTHORIZED.value, data={"detail": "expired token"})
32
32
  except UnicodeDecodeError as exc:
33
33
  log.warning(f"UnicodeDecodeError: {exc}")
34
- except Exception as exc:
35
- log.error(f"Unexpected error: {exc}")
36
- return
@@ -26,7 +26,7 @@ class UserHandler:
26
26
  modified_at = None
27
27
 
28
28
  def __init__(self, payload: dict, request: HttpRequest, access_token: str):
29
- # payload of access token without user info
29
+ self.payload = payload
30
30
  self.kwargs = settings.OIDC_USER_DEFAULTS.copy()
31
31
  self.kwargs[settings.OIDC_USER_UID] = payload[settings.OIDC_TOKEN_USER_UID]
32
32
 
@@ -63,7 +63,7 @@ class UserHandler:
63
63
 
64
64
  user = model.objects.create(**self.kwargs)
65
65
  if self.on_create:
66
- self.on_create(user, self.request)
66
+ self.on_create(user, self.request, self.payload)
67
67
  return user
68
68
 
69
69
  def _get_by_email(self) -> model:
@@ -72,7 +72,7 @@ class UserHandler:
72
72
  user = model.objects.get(email=self.kwargs["email"])
73
73
  self._update_user(user)
74
74
  if self.on_update:
75
- self.on_update(user, self.request)
75
+ self.on_update(user, self.request, self.payload)
76
76
  return user
77
77
 
78
78
  def _update_existing_user(self, user):
@@ -93,7 +93,7 @@ class UserHandler:
93
93
  if self.modified_at and is_modified:
94
94
  self._update_user(user)
95
95
  if self.on_update:
96
- self.on_update(user, self.request)
96
+ self.on_update(user, self.request, self.payload)
97
97
 
98
98
  def get_user(self) -> model:
99
99
  """
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = dj-jwt-auth
3
- version = 1.5.12
3
+ version = 1.6.0
4
4
  description = A Django package for JSON Web Token validation and verification. Using PyJWT.
5
5
  long_description = file: README.md
6
6
  url = https://www.example.com/
@@ -29,12 +29,12 @@ user_info_payload = {
29
29
  User = get_user_model()
30
30
 
31
31
 
32
- def _on_create(user, request):
32
+ def _on_create(user, request, token_data):
33
33
  user.username = "on_create"
34
34
  user.save()
35
35
 
36
36
 
37
- def _on_update(user, request):
37
+ def _on_update(user, request, token_data):
38
38
  user.username = "on_update"
39
39
  user.save()
40
40
 
File without changes
File without changes
File without changes
File without changes
File without changes