File tree Expand file tree Collapse file tree
siteSettings/components/SiteSettingsPage Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -112,18 +112,16 @@ const LoginView = ({ params }: LoginViewProps) => {
112112 } ;
113113 } , [ ] ) ;
114114
115+ const isMain = isMainSchema ( ) ;
116+ const passwordLoginMode = externalAuthenticationsStaging ?. shop ?. passwordLoginMode ;
117+ const passwordLoginEnabled = isMain || passwordLoginMode === PasswordLoginModeEnum . ENABLED ;
118+
115119 return (
116120 < LoginPage
117121 errors = { errors }
118122 disabled = { authenticating }
119123 externalAuthentications = { externalAuthentications ?. shop ?. availableExternalAuthentications }
120- passwordLoginEnabled = {
121- isMainSchema ( ) ||
122- ( externalAuthenticationsStaging ?. shop ?. passwordLoginMode !==
123- PasswordLoginModeEnum . DISABLED &&
124- externalAuthenticationsStaging ?. shop ?. passwordLoginMode !==
125- PasswordLoginModeEnum . CUSTOMERS_ONLY )
126- }
124+ passwordLoginEnabled = { passwordLoginEnabled }
127125 loading = { externalAuthenticationsLoading || authenticating }
128126 onExternalAuthentication = { handleRequestExternalAuthentication }
129127 onSubmit = { handleSubmit }
Original file line number Diff line number Diff line change @@ -2,27 +2,7 @@ import { gql } from "@apollo/client";
22
33export const shopFragment = gql `
44 fragment ShopStaging on Shop {
5- companyAddress {
6- ...Address
7- }
8- countries {
9- code
10- country
11- }
12- customerSetPasswordUrl
13- defaultMailSenderAddress
14- defaultMailSenderName
15- description
16- domain {
17- host
18- }
19- name
20- reserveStockDurationAnonymousUser
21- reserveStockDurationAuthenticatedUser
22- limitQuantityPerCheckout
23- enableAccountConfirmationByEmail
24- useLegacyUpdateWebhookEmission
25- preserveAllAddressFields
5+ ...Shop
266 passwordLoginMode
277 }
288` ;
Original file line number Diff line number Diff line change @@ -100,6 +100,7 @@ const SiteSettingsPage = (props: SiteSettingsPageProps) => {
100100 emailConfirmation : shop ?. enableAccountConfirmationByEmail ?? false ,
101101 useLegacyUpdateWebhookEmission : shop ?. useLegacyUpdateWebhookEmission ?? true ,
102102 preserveAllAddressFields : shop ?. preserveAllAddressFields ?? false ,
103+ // Force staging type to access the new field. Once field is available in main schema, casting should be removed.
103104 passwordLoginMode :
104105 ( isStagingSchema ( ) && ( shop as SiteSettingsStagingQuery [ "shop" ] ) ?. passwordLoginMode ) ||
105106 PasswordLoginModeEnum . ENABLED ,
You can’t perform that action at this time.
0 commit comments