Skip to content

Commit

Permalink
Read 2FA code and send it
Browse files Browse the repository at this point in the history
  • Loading branch information
LeagueOfPoro committed Jan 20, 2023
1 parent 3a4b7a6 commit eb499b5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ def login(self, username: str, password: str, refreshLock) -> bool:
refreshLock.acquire()
twoFactorCode = input(f"Enter 2FA code for {self.account}:\n")
refreshLock.release()
data = {"type": "multifactor", "code": twoFactorCode, "rememberDevice": True}
res = self.client.put(
"https://auth.riotgames.com/api/v1/authorization", json=data)
resJson = res.json()
# Finish OAuth2 login
res = self.client.get(resJson["response"]["parameters"]["uri"])
except KeyError:
Expand Down

0 comments on commit eb499b5

Please sign in to comment.