Skip to content

Commit c97cfe8

Browse files
committed
Move verify domain as first step
1 parent f5dc6b0 commit c97cfe8

3 files changed

Lines changed: 5 additions & 24 deletions

File tree

packages/ui/src/components/ConfigureSSO/ConfigureSSO.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,17 +107,17 @@ const ConfigureSSOSteps = () => {
107107
<ResetCardErrorOnStepChange />
108108
<ConfigureSSOHeader />
109109

110-
<Wizard.Step id='select-provider'>
111-
<SelectProviderStep />
112-
</Wizard.Step>
113-
114110
<Wizard.Step
115111
id='verify-domain'
116112
label='Verify domain'
117113
>
118114
<VerifyDomainStep />
119115
</Wizard.Step>
120116

117+
<Wizard.Step id='select-provider'>
118+
<SelectProviderStep />
119+
</Wizard.Step>
120+
121121
<Wizard.Step
122122
id='configure'
123123
label='Configure'

packages/ui/src/components/ConfigureSSO/deriveInitialStep.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,10 @@ export const deriveInitialStep = (
1212
): WizardStepId => {
1313
const { isDomainTakenByOtherOrg, hasSuccessfulTestRun } = options;
1414

15-
// Go to the verify domain step in order to display warning
16-
if (isDomainTakenByOtherOrg) {
15+
if (isDomainTakenByOtherOrg || !enterpriseConnection) {
1716
return 'verify-domain';
1817
}
1918

20-
// If no initial connection, go to the select provider step
21-
if (!enterpriseConnection) {
22-
return 'select-provider';
23-
}
24-
2519
// Connection is enabled, go to the confirmation step
2620
const isEnabled = enterpriseConnection?.active;
2721
if (isEnabled) {

packages/ui/src/components/ConfigureSSO/steps/VerifyDomainStep.tsx

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,6 @@ export const EnterVerificationCodeStep = ({
313313
emailAddressRef: React.MutableRefObject<EmailAddressResource | undefined>;
314314
}): JSX.Element | null => {
315315
const { user } = useUser();
316-
const { provider, createEnterpriseConnection } = useConfigureSSO();
317316
const card = useCardState();
318317
const { goNext, goPrev } = useWizard();
319318
const primaryEmailAddress = user?.primaryEmailAddress;
@@ -357,18 +356,6 @@ export const EnterVerificationCodeStep = ({
357356
}
358357
}
359358

360-
if (!provider) {
361-
void goNext();
362-
return;
363-
}
364-
365-
try {
366-
await createEnterpriseConnection(provider, emailToVerify);
367-
} catch (err) {
368-
handleError(err as Error, [], card.setError);
369-
return;
370-
}
371-
372359
void goNext();
373360
},
374361
});

0 commit comments

Comments
 (0)