@@ -18,6 +18,7 @@ import {
1818 CLIENT_CONFIGURABLE_METHODS ,
1919 isClientConfigurableMethod ,
2020 isDesktopDrivableMethod ,
21+ isMfaMethodAvailable ,
2122 mfaStepsOf as locationMfaSteps ,
2223 mfaToText ,
2324 setupMethodsOf ,
@@ -63,16 +64,17 @@ export const ConfigureSelectMethodsStep = ({ onCancel }: Props) => {
6364 return configuredMethods . filter ( ( method ) => method !== MfaMethod . Email ) ;
6465 } , [ emailFallback , configuredMethods ] ) ;
6566
66- /** A step the user is already past: it offers a factor the desktop can drive and the account
67- * holds. Mirrors ` usableMfaMethods` , on the session's fresher list of configured factors . */
67+ /** A step the user is already past: it offers a factor the desktop can drive, the account
68+ * holds and the instance runs . Mirrors usableMfaMethods, on the session's fresher list. */
6869 const isStepSatisfied = useCallback (
6970 ( step : MfaStep ) : boolean =>
7071 step . methods . some (
7172 ( entry ) =>
7273 isDesktopDrivableMethod ( entry . method ) &&
73- configuredMethods . includes ( entry . method ) ,
74+ configuredMethods . includes ( entry . method ) &&
75+ isMfaMethodAvailable ( entry . method , instance ) ,
7476 ) ,
75- [ configuredMethods ] ,
77+ [ configuredMethods , instance ] ,
7678 ) ;
7779
7880 const groups = useMemo ( ( ) => {
@@ -99,10 +101,13 @@ export const ConfigureSelectMethodsStep = ({ onCancel }: Props) => {
99101 // A repeatable factor stays offerable once configured, keeping its badge and its pick.
100102 const disabled = ! isMfaFactorOfferable ( method , configuredMethods , setupMethods ) ;
101103 const configured = accountConfigured . includes ( method ) ;
102- const satisfied = configuredMethods . includes ( method ) ;
104+ const available = isMfaMethodAvailable ( method , instance ) ;
105+ const satisfied = configuredMethods . includes ( method ) && available ;
103106
104107 let hint : string | null = null ;
105- if ( disabled && ! configured ) {
108+ if ( ! available ) {
109+ hint = `${ mfaToText ( method , instance ?? undefined ) } is not available on this Defguard instance.` ;
110+ } else if ( disabled && ! configured ) {
106111 if ( satisfied ) {
107112 // Reached only via the email fallback, which registers the factor as it verifies.
108113 hint = `${ mfaToText ( method ) } is required to continue.` ;
@@ -125,7 +130,7 @@ export const ConfigureSelectMethodsStep = ({ onCancel }: Props) => {
125130 hint,
126131 } ;
127132 } ,
128- [ accountConfigured , configuredMethods , setupMethods , selected ] ,
133+ [ accountConfigured , configuredMethods , setupMethods , selected , instance ] ,
129134 ) ;
130135
131136 const { mutate : cancel , isPending : isCancelling } = useMutation ( {
0 commit comments