fix api auth endpoint checking wrong user field

This commit is contained in:
Nick Sweeting 2024-08-22 18:28:23 -07:00
parent 73a3e6aad0
commit 1a03db2b1d
No known key found for this signature in database

View file

@ -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__()