Skip to content

Commit

Permalink
Revert "refactor: use class attribute"
Browse files Browse the repository at this point in the history
This reverts commit 125fdfb.
  • Loading branch information
luqmansen committed Jan 26, 2024
1 parent 125fdfb commit 0a5b184
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions knox/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@ class TokenAuthentication(BaseAuthentication):
- `request.auth` will be an `AuthToken` instance
'''

auth_header_prefix = knox_settings.AUTH_HEADER_PREFIX

def authenticate(self, request):
auth = get_authorization_header(request).split()
prefix = self.auth_header_prefix.encode()
prefix = self.authenticate_header(request).encode()

if not auth:
return None
Expand Down Expand Up @@ -89,7 +87,7 @@ def validate_user(self, auth_token):
return (auth_token.user, auth_token)

def authenticate_header(self, request):
return self.auth_header_prefix
return knox_settings.AUTH_HEADER_PREFIX

def _cleanup_token(self, auth_token) -> bool:
for other_token in auth_token.user.auth_token_set.all():
Expand Down

0 comments on commit 0a5b184

Please sign in to comment.