from rest_framework.response import Response from rest_framework.permissions import AllowAny from pingcap_sso.api.base import Endpoint from pingcap_sso.models import CaptchaStore class CaptchaRefreshEndpoint(Endpoint): permission_classes = (AllowAny, ) def post(self, request, *args, **kwargs): return Response(CaptchaStore.generate_challenge().to_frontend())