Skip to content

Commit 6e2995a

Browse files
committed
added comments
1 parent 7a25d8b commit 6e2995a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/login.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ def login_with_drexel_connect(session: Session) -> Session:
3838
soup = BeautifulSoup(response.text, "html.parser")
3939
data = parse_initial_mfa_page(soup)
4040

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
4143
response = send_request(
4244
session,
4345
config.drexel_connect_base_url + data["url"],
@@ -68,6 +70,7 @@ def login_with_drexel_connect(session: Session) -> Session:
6870
data=data,
6971
method="POST",
7072
)
73+
# the response should be in HTML format that contains the 'verification code' form field
7174
assert (
7275
response.status_code == 200
7376
), "Failed to receive MFA code page from Drexel Connect"
@@ -83,6 +86,7 @@ def login_with_drexel_connect(session: Session) -> Session:
8386
"j_mfaToken": totp_code,
8487
}
8588

89+
# this request sends the MFA code to Drexel Connect
8690
response = send_request(
8791
session,
8892
config.drexel_connect_base_url + parsed_data["url"],
@@ -93,6 +97,7 @@ def login_with_drexel_connect(session: Session) -> Session:
9397
response.status_code == 200
9498
), "Failed to send MFA code to Drexel Connect (final step)"
9599

100+
# the session should now have the required cookies to access the TMS website
96101
return session
97102

98103

0 commit comments

Comments
 (0)