From d74ef30285b86387b081cfadbb1529d3b262ffb0 Mon Sep 17 00:00:00 2001 From: NEZRI Ygal Date: Wed, 26 Jun 2024 12:16:56 +0200 Subject: [PATCH] Resolution of issues related to API key generation and Knox Fixed problems in the generation of API keys with Knox. --- Watcher/Watcher/accounts/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Watcher/Watcher/accounts/api.py b/Watcher/Watcher/accounts/api.py index 5548bb9..d061019 100644 --- a/Watcher/Watcher/accounts/api.py +++ b/Watcher/Watcher/accounts/api.py @@ -19,7 +19,7 @@ def post(self, request, *args, **kwargs): raw_key, _ = generate_api_key(user) return Response({ "user": UserSerializer(user, context=self.get_serializer_context()).data, - "token": AuthToken.objects.create(user)[1] + "token": raw_key })