Skip to content

Commit

Permalink
fix: requires signin parameters to get OTP now
Browse files Browse the repository at this point in the history
  • Loading branch information
proffapt committed Mar 1, 2024
1 parent 2ee0aa8 commit 533621b
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/iitkgp_erp_login/erp.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def get_login_details(ROLL_NUMBER: str, PASSWORD: str, secret_answer: str, sessi
'user_id': ROLL_NUMBER,
'password': PASSWORD,
'answer': secret_answer,
'typeee': 'SI',
'sessionToken': sessionToken,
'requestedUrl': HOMEPAGE_URL,
}
Expand All @@ -91,14 +92,7 @@ def is_otp_required():
def request_otp(headers: dict[str, str], session: requests.Session, login_details: LoginDetails, log: bool = False):
"""Requests an OTP to be sent."""
try:
session.post(OTP_URL,
data={
'typeee': 'SI',
'loginid': login_details["user_id"],
'pass': login_details["password"]
},
headers=headers)

session.post(OTP_URL, data=login_details,headers=headers)
if log: logging.info(" Requested OTP")
except requests.exceptions.RequestException as e:
raise ErpLoginError(f"Failed to request OTP: {str(e)}")
Expand Down

0 comments on commit 533621b

Please sign in to comment.