()
| 886 | } |
| 887 | |
| 888 | function inspectLoginAuthState() { |
| 889 | const retryState = getLoginTimeoutErrorPageState(); |
| 890 | const verificationTarget = getVerificationCodeTarget(); |
| 891 | const passwordInput = getLoginPasswordInput(); |
| 892 | const emailInput = getLoginEmailInput(); |
| 893 | const switchTrigger = findOneTimeCodeLoginTrigger(); |
| 894 | const submitButton = getLoginSubmitButton({ allowDisabled: true }); |
| 895 | const verificationVisible = isVerificationPageStillVisible(); |
| 896 | const addPhonePage = isAddPhonePageReady(); |
| 897 | const consentReady = isStep8Ready(); |
| 898 | const oauthConsentPage = isOAuthConsentPage(); |
| 899 | const baseState = { |
| 900 | state: 'unknown', |
| 901 | url: location.href, |
| 902 | path: location.pathname || '', |
| 903 | retryButton: retryState?.retryButton || null, |
| 904 | retryEnabled: Boolean(retryState?.retryEnabled), |
| 905 | titleMatched: Boolean(retryState?.titleMatched), |
| 906 | detailMatched: Boolean(retryState?.detailMatched), |
| 907 | verificationTarget, |
| 908 | passwordInput, |
| 909 | emailInput, |
| 910 | submitButton, |
| 911 | switchTrigger, |
| 912 | verificationVisible, |
| 913 | addPhonePage, |
| 914 | oauthConsentPage, |
| 915 | consentReady, |
| 916 | }; |
| 917 | |
| 918 | if (verificationTarget) { |
| 919 | return { |
| 920 | ...baseState, |
| 921 | state: 'verification_page', |
| 922 | }; |
| 923 | } |
| 924 | |
| 925 | if (retryState) { |
| 926 | return { |
| 927 | ...baseState, |
| 928 | state: 'login_timeout_error_page', |
| 929 | }; |
| 930 | } |
| 931 | |
| 932 | if (addPhonePage) { |
| 933 | return { |
| 934 | ...baseState, |
| 935 | state: 'add_phone_page', |
| 936 | }; |
| 937 | } |
| 938 | |
| 939 | if (passwordInput || switchTrigger) { |
| 940 | return { |
| 941 | ...baseState, |
| 942 | state: 'password_page', |
| 943 | }; |
| 944 | } |
| 945 |
no test coverage detected