Browse Source

fix api auth endpoint checking wrong user field

Nick Sweeting 1 year ago
parent
commit
1a03db2b1d
1 changed files with 1 additions and 1 deletions
  1. 1 1
      archivebox/api/v1_auth.py

+ 1 - 1
archivebox/api/v1_auth.py

@@ -27,7 +27,7 @@ def get_api_token(request, auth_data: PasswordAuthSchema):
 
     if user:
         # TODO: support multiple tokens in the future, for now we just have one per user
-        api_token, created = APIToken.objects.get_or_create(user=user)
+        api_token, created = APIToken.objects.get_or_create(created_by_id=user.pk)
 
         return api_token.__json__()