api_v1 #15

Merged
cayop merged 8 commits from api_v1 into main 2024-10-24 10:00:11 +00:00
1 changed files with 2 additions and 1 deletions
Showing only changes of commit 78ba2387ec - Show all commits

View File

@ -32,8 +32,9 @@ def NewSnapshot(request):
auth_header = request.headers.get('Authorization')
if not auth_header or not auth_header.startswith('Bearer '):
return JsonResponse({'error': 'Invalid or missing token'}, status=401)
token = auth_header.split(' ')[1].strip("'").strip('"')
token = auth_header.split(' ')[1].strip("'")
tk = Token.objects.filter(token=token).first()
if not tk:
return JsonResponse({'error': 'Invalid or missing token'}, status=401)