Skip to content

Commit 3d7aab7

Browse files
committed
feat(console): add dev feature guard
1 parent 646d962 commit 3d7aab7

File tree

1 file changed

+9
-7
lines changed
  • packages/console/src/pages/SignInExperience/PageContent/SignUpAndSignIn/SignInForm/SignInMethodEditBox

1 file changed

+9
-7
lines changed

packages/console/src/pages/SignInExperience/PageContent/SignUpAndSignIn/SignInForm/SignInMethodEditBox/index.tsx

+9-7
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { conditional } from '@silverhand/essentials';
33
import { Controller, useFieldArray, useFormContext } from 'react-hook-form';
44
import { useTranslation } from 'react-i18next';
55

6+
import { isDevFeaturesEnabled } from '@/consts/env';
67
import { DragDropProvider, DraggableItem } from '@/ds-components/DragDrop';
78
import useEnabledConnectorTypes from '@/hooks/use-enabled-connector-types';
89

@@ -102,15 +103,16 @@ function SignInMethodEditBox() {
102103
render={({ field: { value }, fieldState: { error } }) => (
103104
<SignInMethodItem
104105
signInMethod={value}
105-
isPasswordCheckable={identifier !== SignInIdentifier.Username}
106+
isPasswordCheckable={
107+
identifier !== SignInIdentifier.Username &&
108+
(isDevFeaturesEnabled || !isSignUpPasswordRequired)
109+
}
106110
isVerificationCodeCheckable={
107-
/**
108-
* Verification code settings are only editable when password is mandatory for sign-up.
109-
* Note: Email and phone number identifiers always require verification during sign-up at the moment.
110-
*/
111-
!isSignUpVerificationRequired || isSignUpPasswordRequired
111+
!(isSignUpVerificationRequired && !isSignUpPasswordRequired)
112+
}
113+
isDeletable={
114+
isDevFeaturesEnabled || !requiredSignInIdentifiers.includes(identifier)
112115
}
113-
isDeletable={!requiredSignInIdentifiers.includes(identifier)}
114116
requiredConnectors={requiredConnectors}
115117
hasError={Boolean(error)}
116118
errorMessage={error?.message}

0 commit comments

Comments
 (0)