EdupageAPI / edupage-api

A python library for accessing your Edupage account
https://edupageapi.github.io/edupage-api/
GNU General Public License v3.0
66 stars 13 forks source link

[Feature request] Add support for 2FA #74

Closed ivanhrabcak closed 6 months ago

ivanhrabcak commented 6 months ago

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 ```