File tree 2 files changed +15
-3
lines changed
2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change 6
6
7
7
from core .template import UserTemplates
8
8
from lib .common import session_member_key
9
- from lib .dependency .dependencies import set_current_connect
9
+ from lib .dependency .dependencies import set_current_connect , validate_login_url
10
10
from lib .member import is_super_admin
11
11
from lib .social import providers
12
12
from lib .social .social import SocialProvider , oauth
@@ -36,10 +36,10 @@ async def login_form(
36
36
async def login (
37
37
request : Request ,
38
38
member_service : Annotated [MemberService , Depends ()],
39
+ url : Annotated [str , Depends (validate_login_url )],
39
40
mb_id : str = Form (...),
40
41
mb_password : str = Form (...),
41
42
auto_login : bool = Form (default = False ),
42
- url : str = Form (default = "/" )
43
43
):
44
44
"""로그인 폼화면에서 로그인"""
45
45
member = member_service .authenticate_member (mb_id , mb_password )
Original file line number Diff line number Diff line change @@ -254,4 +254,16 @@ async def set_current_connect(
254
254
255
255
except ProgrammingError as e :
256
256
print (e )
257
-
257
+
258
+
259
+ def validate_login_url (url : str = Form (default = "/" )):
260
+ """
261
+ 로그인할 때 url을 검사하는 함수
262
+ """
263
+ allow_urls = []
264
+
265
+ if (url
266
+ and not url .startswith ("/" )
267
+ and url not in allow_urls ):
268
+ raise AlertException ("올바르지 않은 URL입니다." , 400 )
269
+ return url
You can’t perform that action at this time.
0 commit comments