mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 09:25:06 +03:00
chore: mfa enhanced entitlement (#41611)
Depends on https://github.com/supabase/platform/pull/28639 ### Changes - Add entitlement check for auth.mfa_enhanced_security feature in MFA settings - Disable the "Limit duration of AAL1 sessions" toggle when user lacks entitlement - Show upgrade prompt when Enhanced MFA Security is not available on user's plan <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Enhanced MFA Security option with upgrade availability * Cloud Marketplace contract linking eligibility checks * New entitlements: SOC2 reports, Private Link, realtime concurrency controls, function limits, project-scoped roles <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
1 parent
23d038801d
commit
de4fbfb731
1 file changed
+23
-4
@@ -116,9 +116,17 @@ export const MfaAuthSettingsForm = () => {
|
||||
'custom_config_gotrue'
|
||||
)
|
||||
|
||||
const { hasAccess: hasAccessToMFA, isLoading: isLoadingEntitlement } =
|
||||
const { hasAccess: hasAccessToMFAEntitlement, isLoading: isLoadingEntitlement } =
|
||||
useCheckEntitlements('auth.mfa_phone')
|
||||
const promptProPlanUpgrade = IS_PLATFORM && !hasAccessToMFA
|
||||
const hasAccessToMFA = !IS_PLATFORM || hasAccessToMFAEntitlement
|
||||
const promptProPlanUpgrade = IS_PLATFORM && !hasAccessToMFAEntitlement
|
||||
|
||||
const {
|
||||
hasAccess: hasAccessToEnhanceSecurityEntitlement,
|
||||
isLoading: isLoadingEntitlementEnhanceSecurity,
|
||||
} = useCheckEntitlements('auth.mfa_enhanced_security')
|
||||
const hasAccessToEnhanceSecurity = !IS_PLATFORM || hasAccessToEnhanceSecurityEntitlement
|
||||
const promptEnhancedSecurityUpgrade = IS_PLATFORM && !hasAccessToEnhanceSecurityEntitlement
|
||||
|
||||
// For now, we support Twilio and Vonage. Twilio Verify is not supported and the remaining providers are community maintained.
|
||||
const sendSMSHookIsEnabled =
|
||||
@@ -282,7 +290,7 @@ export const MfaAuthSettingsForm = () => {
|
||||
)
|
||||
}
|
||||
|
||||
if (isLoading || isLoadingEntitlement) {
|
||||
if (isLoading || isLoadingEntitlement || isLoadingEntitlementEnhanceSecurity) {
|
||||
return (
|
||||
<PageSection>
|
||||
<PageSectionContent>
|
||||
@@ -580,13 +588,24 @@ export const MfaAuthSettingsForm = () => {
|
||||
<Switch
|
||||
checked={!field.value}
|
||||
onCheckedChange={(value) => field.onChange(!value)}
|
||||
disabled={!canUpdateConfig}
|
||||
disabled={!canUpdateConfig || !hasAccessToEnhanceSecurity}
|
||||
/>
|
||||
</FormControl_Shadcn_>
|
||||
</FormItemLayout>
|
||||
)}
|
||||
/>
|
||||
</CardContent>
|
||||
|
||||
{promptEnhancedSecurityUpgrade && (
|
||||
<UpgradeToPro
|
||||
fullWidth
|
||||
source="authEnhancedSecurity"
|
||||
featureProposition="configure settings for Enhanced MFA Security"
|
||||
primaryText="Enhanced MFA Security is not available on your plan"
|
||||
secondaryText="Upgrade your plan to configure settings for Enhanced MFA Security"
|
||||
buttonText="Upgrade"
|
||||
/>
|
||||
)}
|
||||
<CardFooter className="justify-end space-x-2">
|
||||
{securityForm.formState.isDirty && (
|
||||
<Button type="default" onClick={() => securityForm.reset()}>
|
||||
|
||||
Reference in new issue
Block a user