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

Commit 6bba10c

Browse files
committed
verify2fa -> verify_mfa
1 parent b543c5b commit 6bba10c

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

vrcpy/client.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -354,16 +354,14 @@ async def login_auth_token(self):
354354
async def verify_mfa(self, mfa: str):
355355
'''
356356
Used to verify authtoken on 2fa enabled accounts
357-
358357
mfa, string
359358
2FactorAuth code (totp or otp)
360359
'''
361360

362-
logging.debug("Verifying 2fa authtoken")
361+
logging.debug("Verifying MFA authtoken")
363362

364-
if type(mfa) is not str:
365-
raise ClientErrors.MfaInvalid(
366-
"{} is not a valid 2fa code".format(mfa))
363+
if type(mfa) is not str or not (len(mfa) == 6 or len(mfa) == 8):
364+
raise ClientErrors.MfaInvalid("{} is not a valid MFA code".format(mfa))
367365

368366
await self.request.post("/auth/twofactorauth/{}/verify".format(
369367
"totp" if len(mfa) == 6 else "otp"
@@ -372,7 +370,6 @@ async def verify_mfa(self, mfa: str):
372370
async def logout(self, unauth=True):
373371
'''
374372
Closes client session and logs out VRC user
375-
376373
unauth, bool
377374
If should unauth the session cookie
378375
'''

0 commit comments

Comments
 (0)