From 1a03db2b1d8d8b9d20ac063ad2ef46fcb70d0b19 Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Thu, 22 Aug 2024 18:28:23 -0700 Subject: [PATCH] fix api auth endpoint checking wrong user field --- archivebox/api/v1_auth.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/archivebox/api/v1_auth.py b/archivebox/api/v1_auth.py index 070aa359..289380cc 100644 --- a/archivebox/api/v1_auth.py +++ b/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__()