feat: address QA feedback and limit Checko collection
Some checks failed
CI/CD Pipeline / Quality Gate (push) Failing after 25s
CI/CD Pipeline / Build and Push Images (push) Has been skipped
CI/CD Pipeline / Deploy Dev via Compose (push) Has been skipped
CI/CD Pipeline / Internal Notify (push) Successful in 0s

This commit is contained in:
2026-07-19 13:32:46 +02:00
parent 63f59b3799
commit 76aed1dca3
17 changed files with 730 additions and 41 deletions

View File

@@ -13,6 +13,7 @@ from rest_framework.exceptions import ValidationError
from rest_framework.permissions import AllowAny, IsAdminUser, IsAuthenticated
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework_simplejwt.serializers import TokenRefreshSerializer
from rest_framework_simplejwt.views import TokenRefreshView as SimpleJWTTokenRefreshView
from rest_framework_simplejwt.views import TokenVerifyView as SimpleJWTTokenVerifyView
@@ -646,10 +647,20 @@ def user_profile_detail(request):
return Response(profile_data)
class ReusableTokenRefreshSerializer(TokenRefreshSerializer):
"""Return the unchanged refresh token for concurrent frontend requests."""
def validate(self, attrs):
payload = super().validate(attrs)
payload["refresh"] = attrs["refresh"]
return payload
class TokenRefreshView(SimpleJWTTokenRefreshView):
"""Обновление access токена через refresh токен."""
permission_classes = [AllowAny]
serializer_class = ReusableTokenRefreshSerializer
@swagger_auto_schema(
tags=[AUTH_TAG],