Skip to content
This repository was archived by the owner on Dec 20, 2021. It is now read-only.

Commit 6460753

Browse files
committed
totp and otp support
1 parent b504d2b commit 6460753

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

vrcpy/client.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,10 @@ def verify2fa(self, code):
329329
'''
330330

331331
if self.loggedIn: raise AlreadyLoggedInError("Client is already logged in")
332+
resp = self.api.call(
333+
"/auth/twofactorauth/{}/verify".format("totp" if len(code) == 6 else "otp"),
334+
"POST", json={"code": code}
335+
)
332336

333337
resp = self.api.call("/auth/twofactorauth/totp/verify", "POST", json={"code": code})
334338
resp = self.api.call("/auth/user")
@@ -665,6 +669,10 @@ async def verify2fa(self, code):
665669
'''
666670

667671
if self.loggedIn: raise AlreadyLoggedInError("Client is already logged in")
672+
await self.api.call(
673+
"/auth/twofactorauth/{}/verify".format("totp" if len(code) == 6 else "otp"),
674+
"POST", json={"code": code}
675+
)
668676

669677
await self.api.call("/auth/twofactorauth/totp/verify", "POST", json={"code": code})
670678
resp = await self.api.call("/auth/user")

0 commit comments

Comments
 (0)