File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -31,8 +31,17 @@ async def auth_login(username: str = Form(...),
3131 if timezone != "" :
3232 cl .set_timezone_offset (timezone )
3333
34- # We're mocking the input
35- with patch ('builtins.input' , return_value = verification_code ):
34+ # Handle 2FA if verification code is provided
35+ if verification_code :
36+ # Try login with 2FA code directly
37+ try :
38+ result = cl .login (username , password , verification_code = verification_code )
39+ except TypeError :
40+ # Fallback to mocking input if the direct parameter doesn't work
41+ with patch ('builtins.input' , return_value = verification_code ):
42+ result = cl .login (username , password )
43+ else :
44+ # Regular login without 2FA
3645 result = cl .login (username , password )
3746
3847 if result :
You can’t perform that action at this time.
0 commit comments