File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,8 @@ def login_with_drexel_connect(session: Session) -> Session:
38
38
soup = BeautifulSoup (response .text , "html.parser" )
39
39
data = parse_initial_mfa_page (soup )
40
40
41
+ # the intial MFA page does not have the 'verification code' form field
42
+ # the following two requests are sent to fetch the html page with the 'verification code' form field
41
43
response = send_request (
42
44
session ,
43
45
config .drexel_connect_base_url + data ["url" ],
@@ -68,6 +70,7 @@ def login_with_drexel_connect(session: Session) -> Session:
68
70
data = data ,
69
71
method = "POST" ,
70
72
)
73
+ # the response should be in HTML format that contains the 'verification code' form field
71
74
assert (
72
75
response .status_code == 200
73
76
), "Failed to receive MFA code page from Drexel Connect"
@@ -83,6 +86,7 @@ def login_with_drexel_connect(session: Session) -> Session:
83
86
"j_mfaToken" : totp_code ,
84
87
}
85
88
89
+ # this request sends the MFA code to Drexel Connect
86
90
response = send_request (
87
91
session ,
88
92
config .drexel_connect_base_url + parsed_data ["url" ],
@@ -93,6 +97,7 @@ def login_with_drexel_connect(session: Session) -> Session:
93
97
response .status_code == 200
94
98
), "Failed to send MFA code to Drexel Connect (final step)"
95
99
100
+ # the session should now have the required cookies to access the TMS website
96
101
return session
97
102
98
103
You can’t perform that action at this time.
0 commit comments