remove quotas in string of token fixed more

This commit is contained in:
Cayo Puigdefabregas 2024-10-22 10:09:53 +02:00
parent ff92e28b97
commit ba94a01062
1 changed files with 2 additions and 1 deletions

View File

@ -33,7 +33,8 @@ def NewSnapshot(request):
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("'")
token = auth_header.split(' ')[1].strip("'").strip('"')
tk = Token.objects.filter(token=token).first()
if not tk:
return JsonResponse({'error': 'Invalid or missing token'}, status=401)