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 10
10
path ('profile' , views .AuthProfile .as_view ()),
11
11
path ('application/profile' , views .ApplicationProfile .as_view ()),
12
12
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' ),
14
15
]
Original file line number Diff line number Diff line change 21
21
from common .constants .permission_constants import ChatAuth
22
22
from common .exception .app_exception import AppAuthenticationFailed
23
23
from common .result import result
24
+ from users .api import CaptchaAPI
25
+ from users .serializers .login import CaptchaSerializer
24
26
25
27
26
28
class AnonymousAuthentication (APIView ):
@@ -122,3 +124,14 @@ def get(self, request: Request):
122
124
data = {'application_id' : request .auth .application_id ,
123
125
'chat_user_id' : request .auth .chat_user_id , 'chat_user_type' : request .auth .chat_user_type ,
124
126
'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