diff --git a/src/pages/signin/SAMLSignInPage/index.native.tsx b/src/pages/signin/SAMLSignInPage/index.native.tsx index b252cb9cbed2..a96859e876fd 100644 --- a/src/pages/signin/SAMLSignInPage/index.native.tsx +++ b/src/pages/signin/SAMLSignInPage/index.native.tsx @@ -10,7 +10,7 @@ import useLocalize from '@hooks/useLocalize'; import getPlatform from '@libs/getPlatform'; import getUAForWebView from '@libs/getUAForWebView'; import Log from '@libs/Log'; -import {handleSAMLLoginError, postSAMLLogin} from '@libs/LoginUtils'; +import * as LoginUtils from '@libs/LoginUtils'; import Navigation from '@libs/Navigation/Navigation'; import * as Session from '@userActions/Session'; import CONFIG from '@src/CONFIG'; @@ -28,7 +28,7 @@ function SAMLSignInPage() { useEffect(() => { // If we don't have a valid login to pass here, direct the user back to a clean sign in state to try again if (!credentials?.login) { - handleSAMLLoginError(translate('common.error.email'), true); + LoginUtils.handleSAMLLoginError(translate('common.error.email'), true); return; } @@ -41,16 +41,16 @@ function SAMLSignInPage() { body.append('email', credentials.login); body.append('referer', CONFIG.EXPENSIFY.EXPENSIFY_CASH_REFERER); body.append('platform', getPlatform()); - postSAMLLogin(body) + LoginUtils.postSAMLLogin(body) .then((response) => { if (!response || !response.url) { - handleSAMLLoginError(translate('common.error.login'), false); + LoginUtils.handleSAMLLoginError(translate('common.error.login'), false); return; } setSAMLUrl(response.url); }) .catch((error: Error) => { - handleSAMLLoginError(error.message ?? translate('common.error.login'), false); + LoginUtils.handleSAMLLoginError(error.message ?? translate('common.error.login'), false); }); }, [credentials?.login, SAMLUrl, translate]); @@ -104,7 +104,7 @@ function SAMLSignInPage() { /> )} - {!!SAMLUrl && ( + {!!SAMLUrl ? ( } onNavigationStateChange={handleNavigationStateChange} /> + ) : ( + )} diff --git a/src/pages/signin/SAMLSignInPage/index.tsx b/src/pages/signin/SAMLSignInPage/index.tsx index e0c02a0d7b93..c78bce74c01b 100644 --- a/src/pages/signin/SAMLSignInPage/index.tsx +++ b/src/pages/signin/SAMLSignInPage/index.tsx @@ -2,7 +2,7 @@ import React, {useEffect} from 'react'; import {useOnyx} from 'react-native-onyx'; import SAMLLoadingIndicator from '@components/SAMLLoadingIndicator'; import useLocalize from '@hooks/useLocalize'; -import {handleSAMLLoginError, postSAMLLogin} from '@libs/LoginUtils'; +import * as LoginUtils from '@libs/LoginUtils'; import CONFIG from '@src/CONFIG'; import ONYXKEYS from '@src/ONYXKEYS'; @@ -13,7 +13,7 @@ function SAMLSignInPage() { useEffect(() => { // If we don't have a valid login to pass here, direct the user back to a clean sign in state to try again if (!credentials?.login) { - handleSAMLLoginError(translate('common.error.email'), true); + LoginUtils.handleSAMLLoginError(translate('common.error.email'), true); return; } @@ -21,16 +21,16 @@ function SAMLSignInPage() { body.append('email', credentials.login); body.append('referer', CONFIG.EXPENSIFY.EXPENSIFY_CASH_REFERER); - postSAMLLogin(body) + LoginUtils.postSAMLLogin(body) .then((response) => { if (!response || !response.url) { - handleSAMLLoginError(translate('common.error.login'), false); + LoginUtils.handleSAMLLoginError(translate('common.error.login'), false); return; } window.location.replace(response.url); }) .catch((error: Error) => { - handleSAMLLoginError(error.message ?? translate('common.error.login'), false); + LoginUtils.handleSAMLLoginError(error.message ?? translate('common.error.login'), false); }); }, [credentials?.login, translate]);