Is your feature request related to a problem? Please describe.
Add an API that would allow users with 2FA to login.
Describe the solution you'd like
The API could look like this:
OUTDATED CODE: See the PR for up-to-date details
```python3
edupage = Edupage()
# a regular login throws an exception if the second factor is required:
try:
edupage.login("username", "password", "subdomain")
except SecondFactorRequiredException:
print("Login failed - second factor is required")
```
And logging in with the code:
```python3
pending_login = edupage.login_2fa("username", "password", "subdomain")
pending_login.code("2facode")
print(edupage.is_logged_in) # True
```
Is your feature request related to a problem? Please describe. Add an API that would allow users with 2FA to login.
Describe the solution you'd like
The API could look like this:
OUTDATED CODE: See the PR for up-to-date details
```python3 edupage = Edupage() # a regular login throws an exception if the second factor is required: try: edupage.login("username", "password", "subdomain") except SecondFactorRequiredException: print("Login failed - second factor is required") ``` And logging in with the code: ```python3 pending_login = edupage.login_2fa("username", "password", "subdomain") pending_login.code("2facode") print(edupage.is_logged_in) # True ```