Fix broken token authentication
This commit is contained in:
parent
3abdd9b180
commit
a73fba0f1b
@ -10,7 +10,7 @@ EXPIRE_HOURS = getattr(settings, 'REST_FRAMEWORK_TOKEN_EXPIRE_HOURS', 24)
|
||||
|
||||
class ExpiringTokenAuthentication(TokenAuthentication):
|
||||
def authenticate_credentials(self, key):
|
||||
print(key)
|
||||
#print(key)
|
||||
try:
|
||||
token = Token.objects.get(key=key)
|
||||
except Token.DoesNotExist:
|
||||
|
@ -1,5 +1,6 @@
|
||||
from django.shortcuts import render
|
||||
from django.contrib.auth.models import User, Group
|
||||
from django.core.exceptions import ObjectDoesNotExist
|
||||
from rest_framework import viewsets, status
|
||||
from rest_framework import permissions
|
||||
from rest_framework.views import APIView
|
||||
|
@ -39,6 +39,8 @@ INSTALLED_APPS = [
|
||||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
'parts.apps.PartsConfig',
|
||||
'api.apps.ApiConfig',
|
||||
'rest_framework.authtoken',
|
||||
'qr_code',
|
||||
'rest_framework',
|
||||
'crispy_forms',
|
||||
|
@ -56,6 +56,8 @@ INSTALLED_APPS = [
|
||||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
'parts.apps.PartsConfig',
|
||||
'api.apps.ApiConfig',
|
||||
'rest_framework.authtoken',
|
||||
'qr_code',
|
||||
'rest_framework',
|
||||
'crispy_forms',
|
||||
|
Loading…
Reference in New Issue
Block a user