Fixes: 1) Correct token decoding in user activation workflow to prevent potential errors;

Extra: None;
This commit is contained in:
Egor Pavlovich Gorbunov 2025-05-28 15:30:25 +03:00
parent 7f761f751a
commit 61287dfd16

View file

@ -105,7 +105,7 @@ class UserViewSet(
try: try:
uuid = urlsafe_base64_decode(request.data.get("uidb64")).decode() uuid = urlsafe_base64_decode(request.data.get("uidb64")).decode()
user = User.objects.nocache().get(pk=uuid) user = User.objects.nocache().get(pk=uuid)
if not user.check_token(urlsafe_base64_decode(request.data.get("token"))): if not user.check_token(urlsafe_base64_decode(request.data.get("token")).decode()):
return Response( return Response(
{"error": _("activation link is invalid!")}, {"error": _("activation link is invalid!")},
status=status.HTTP_400_BAD_REQUEST, status=status.HTTP_400_BAD_REQUEST,