@@ -13,6 +13,7 @@ import CompassIcon from '@components/compass_icon';
1313import FloatingTextInput from '@components/floating_input/floating_text_input_label' ;
1414import FormattedText from '@components/formatted_text' ;
1515import { FORGOT_PASSWORD , MFA } from '@constants/screens' ;
16+ import { LOGIN_TYPE } from '@constants/sso' ;
1617import { useAvoidKeyboard } from '@hooks/device' ;
1718import { usePreventDoubleTap } from '@hooks/utils' ;
1819import { goToScreen , loginAnimationOptions , resetToHome } from '@screens/navigation' ;
@@ -45,7 +46,7 @@ function getButtonDisabled(loginId: string, password: string, userLoginType: Log
4546 return true ;
4647 }
4748
48- if ( magicLinkEnabled && ( userLoginType === 'guest_magic_link' || userLoginType === undefined ) ) {
49+ if ( magicLinkEnabled && ( userLoginType === LOGIN_TYPE . MAGIC_LINK || userLoginType === undefined ) ) {
4950 return false ;
5051 }
5152
@@ -248,7 +249,7 @@ const LoginForm = ({
248249 Keyboard . dismiss ( ) ;
249250 if ( magicLinkEnabled && userLoginType === undefined ) {
250251 const receivedUserLoginType = await checkUserLoginType ( ) ;
251- if ( receivedUserLoginType === 'guest_magic_link' ) {
252+ if ( receivedUserLoginType === LOGIN_TYPE . MAGIC_LINK ) {
252253 setMagicLinkSent ( true ) ;
253254 }
254255 if ( isDeactivated ) {
@@ -310,7 +311,7 @@ const LoginForm = ({
310311 } , [ managedConfig ?. username ] ) ;
311312
312313 const onIdInputSubmitting = useCallback ( ( ) => {
313- if ( ! magicLinkEnabled || ( userLoginType !== 'guest_magic_link' ) ) {
314+ if ( ! magicLinkEnabled || ( userLoginType !== LOGIN_TYPE . MAGIC_LINK ) ) {
314315 focusPassword ( ) ;
315316 return ;
316317 }
@@ -319,7 +320,7 @@ const LoginForm = ({
319320 } , [ focusPassword , onLogin , magicLinkEnabled , userLoginType ] ) ;
320321
321322 const buttonDisabled = getButtonDisabled ( loginId , password , userLoginType , isDeactivated , magicLinkEnabled ) ;
322- const showPasswordInput = ! magicLinkEnabled || ( userLoginType !== 'guest_magic_link' && userLoginType !== undefined && ! isDeactivated ) ;
323+ const showPasswordInput = ! magicLinkEnabled || ( userLoginType !== LOGIN_TYPE . MAGIC_LINK && userLoginType !== undefined && ! isDeactivated ) ;
323324 let userInputError = error ;
324325 if ( showPasswordInput ) {
325326 // error is passed to the password input box, so we use this
0 commit comments