Skip to content

Commit

Permalink
fixed TOTP for #3
Browse files Browse the repository at this point in the history
  • Loading branch information
henrydatei committed Oct 1, 2022
1 parent 2ea49fd commit 43dd1ab
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions wikifolio.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,8 @@ def buy_quote(self, amount: int, isin: str) -> OrderResponse:
ws.close()

if self.twoFA_key != None:
auth = requests.post('https://www.wikifolio.com/api/totp/verify', data = self.twoFA_key, cookies = self.cookie)
totp = TOTP(self.twoFA_key)
auth = requests.post('https://www.wikifolio.com/api/totp/verify', data = totp.now(), cookies = self.cookie)
cookies = auth.cookies
else:
cookies = self.cookie
Expand Down Expand Up @@ -672,7 +673,8 @@ def sell_quote(self, amount: int, isin: str) -> OrderResponse:
ws.close()

if self.twoFA_key != None:
auth = requests.post('https://www.wikifolio.com/api/totp/verify', data = self.twoFA_key, cookies = self.cookie)
totp = TOTP(self.twoFA_key)
auth = requests.post('https://www.wikifolio.com/api/totp/verify', data = totp.now(), cookies = self.cookie)
cookies = auth.cookies
else:
cookies = self.cookie
Expand Down

0 comments on commit 43dd1ab

Please sign in to comment.