Skip to content

Commit

Permalink
fix: fix maximum error exceeded on auth class
Browse files Browse the repository at this point in the history
- use of wrong method
- update of method authenticate_header on Auth classes.
  • Loading branch information
idenyigabriel committed Jun 17, 2024
1 parent 9af4511 commit daa314a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 0.3.6

Fixes:
- auth class accessing wrong method
- update authenticate_header on auth classes

## 0.3.5

Docs
Expand Down
7 changes: 2 additions & 5 deletions drf_authentify/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def authenticate(self, request):
raise AuthenticationFailed()
return None

def get_request_token(self, request):
def authenticate_header(self, request):
auth = request.META["HTTP_AUTHORIZATION"].split()
allowed_prefixes = [
prefix.lower() for prefix in authentify_settings.ALLOWED_HEADER_PREFIXES
Expand All @@ -29,9 +29,6 @@ def get_request_token(self, request):
return None
return auth[1]

def authenticate_header(self, request):
return request.auth[0].capitalize()


class CookieAuthentication(BaseAuthentication):
"""Simple cookie based authentication."""
Expand All @@ -47,4 +44,4 @@ def authenticate(self, request):
return None

def authenticate_header(self, request):
return "Set-Cookie: token=value"
return request.COOKIES[authentify_settings.COOKIE_KEY]
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = 'setuptools.build_meta'

[project]
name = "drf-authentify"
version = "0.3.5"
version = "0.3.6"
description = "A simple authentication module for django rest framework"
readme = {file = "README.md", content-type = "text/markdown"}
license = {file = "LICENSE"}
Expand Down

0 comments on commit daa314a

Please sign in to comment.