File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 1010 path ('profile' , views .AuthProfile .as_view ()),
1111 path ('application/profile' , views .ApplicationProfile .as_view ()),
1212 path ('chat_message/<str:chat_id>' , views .ChatView .as_view ()),
13- path ('open' , views .OpenView .as_view ())
13+ path ('open' , views .OpenView .as_view ()),
14+ path ('captcha' , views .CaptchaView .as_view (), name = 'captcha' ),
1415]
Original file line number Diff line number Diff line change 2121from common .constants .permission_constants import ChatAuth
2222from common .exception .app_exception import AppAuthenticationFailed
2323from common .result import result
24+ from users .api import CaptchaAPI
25+ from users .serializers .login import CaptchaSerializer
2426
2527
2628class AnonymousAuthentication (APIView ):
@@ -122,3 +124,14 @@ def get(self, request: Request):
122124 data = {'application_id' : request .auth .application_id ,
123125 'chat_user_id' : request .auth .chat_user_id , 'chat_user_type' : request .auth .chat_user_type ,
124126 'debug' : False }).open ())
127+
128+
129+ class CaptchaView (APIView ):
130+ @extend_schema (methods = ['GET' ],
131+ summary = _ ("Get captcha" ),
132+ description = _ ("Get captcha" ),
133+ operation_id = _ ("Get captcha" ), # type: ignore
134+ tags = [_ ("User Management" )], # type: ignore
135+ responses = CaptchaAPI .get_response ())
136+ def get (self , request : Request ):
137+ return result .success (CaptchaSerializer ().generate ())
You can’t perform that action at this time.
0 commit comments