diff --git a/packages/snjs/lib/Application/Application.ts b/packages/snjs/lib/Application/Application.ts index f95169bb9..77bca2f47 100644 --- a/packages/snjs/lib/Application/Application.ts +++ b/packages/snjs/lib/Application/Application.ts @@ -1035,10 +1035,6 @@ export class SNApplication implements ApplicationInterface, AppGroupManagedAppli } } - public isMfaFeatureAvailable(): boolean { - return this.mfaService.isMfaFeatureAvailable() - } - public async isMfaActivated(): Promise { return this.mfaService.isMfaActivated() } diff --git a/packages/snjs/lib/Services/Mfa/MfaService.ts b/packages/snjs/lib/Services/Mfa/MfaService.ts index ecccba7c9..a7225725e 100644 --- a/packages/snjs/lib/Services/Mfa/MfaService.ts +++ b/packages/snjs/lib/Services/Mfa/MfaService.ts @@ -3,7 +3,6 @@ import { SettingName } from '@standardnotes/settings' import { SNSettingsService } from '../Settings' import { PureCryptoInterface } from '@standardnotes/sncrypto-common' import { SNFeaturesService } from '../Features/FeaturesService' -import { FeatureIdentifier } from '@standardnotes/features' import { AbstractService, InternalEventBusInterface, SignInStrings } from '@standardnotes/services' export class SNMfaService extends AbstractService { @@ -47,17 +46,6 @@ export class SNMfaService extends AbstractService { return await this.settingsService.deleteSetting(SettingName.MfaSecret) } - isMfaFeatureAvailable(): boolean { - const feature = this.featuresService.getUserFeature(FeatureIdentifier.TwoFactorAuth) - - // If the feature is not present in the collection, we don't want to block it - if (feature == undefined) { - return false - } - - return feature.no_expire === true || (feature.expires_at ?? 0) > Date.now() - } - override deinit(): void { ;(this.settingsService as unknown) = undefined ;(this.crypto as unknown) = undefined diff --git a/packages/web/src/javascripts/Components/Preferences/Panes/Security/TwoFactorAuth/TwoFactorAuth.ts b/packages/web/src/javascripts/Components/Preferences/Panes/Security/TwoFactorAuth/TwoFactorAuth.ts index 1263e38c0..7b62ef01a 100644 --- a/packages/web/src/javascripts/Components/Preferences/Panes/Security/TwoFactorAuth/TwoFactorAuth.ts +++ b/packages/web/src/javascripts/Components/Preferences/Panes/Security/TwoFactorAuth/TwoFactorAuth.ts @@ -81,10 +81,6 @@ export class TwoFactorAuth { return } - if (!this.isMfaFeatureAvailable()) { - return - } - this.mfaProvider .isMfaActivated() .then( @@ -110,10 +106,6 @@ export class TwoFactorAuth { return } - if (!this.isMfaFeatureAvailable()) { - return - } - if (this._status === 'two-factor-disabled') { return this.startActivation() } @@ -130,8 +122,4 @@ export class TwoFactorAuth { get status(): TwoFactorStatus | 'fetching' { return this._status } - - isMfaFeatureAvailable(): boolean { - return this.mfaProvider.isMfaFeatureAvailable() - } } diff --git a/packages/web/src/javascripts/Components/Preferences/Panes/Security/TwoFactorAuth/TwoFactorAuthView/TwoFactorDescription.tsx b/packages/web/src/javascripts/Components/Preferences/Panes/Security/TwoFactorAuth/TwoFactorAuthView/TwoFactorDescription.tsx index 838952018..4a72b4f00 100644 --- a/packages/web/src/javascripts/Components/Preferences/Panes/Security/TwoFactorAuth/TwoFactorAuthView/TwoFactorDescription.tsx +++ b/packages/web/src/javascripts/Components/Preferences/Panes/Security/TwoFactorAuth/TwoFactorAuthView/TwoFactorDescription.tsx @@ -11,17 +11,7 @@ const TwoFactorDescription: FunctionComponent = ({ auth }) => { if (!auth.isLoggedIn()) { return Sign in or register for an account to configure 2FA. } - if (!auth.isMfaFeatureAvailable()) { - return ( - - A paid subscription plan is required to enable 2FA.{' '} - - Learn more - - . - - ) - } + return An extra layer of security when logging in to your account. } diff --git a/packages/web/src/javascripts/Components/Preferences/Panes/Security/TwoFactorAuth/TwoFactorAuthView/TwoFactorSwitch.tsx b/packages/web/src/javascripts/Components/Preferences/Panes/Security/TwoFactorAuth/TwoFactorAuthView/TwoFactorSwitch.tsx index f9ab28cb0..eecfb8b99 100644 --- a/packages/web/src/javascripts/Components/Preferences/Panes/Security/TwoFactorAuth/TwoFactorAuthView/TwoFactorSwitch.tsx +++ b/packages/web/src/javascripts/Components/Preferences/Panes/Security/TwoFactorAuth/TwoFactorAuthView/TwoFactorSwitch.tsx @@ -9,7 +9,7 @@ type Props = { } const TwoFactorSwitch: FunctionComponent = ({ auth }) => { - if (!(auth.isLoggedIn() && auth.isMfaFeatureAvailable())) { + if (!auth.isLoggedIn()) { return null } diff --git a/packages/web/src/javascripts/Components/Preferences/Panes/Security/TwoFactorAuth/TwoFactorAuthView/TwoFactorTitle.tsx b/packages/web/src/javascripts/Components/Preferences/Panes/Security/TwoFactorAuth/TwoFactorAuthView/TwoFactorTitle.tsx index b48e3787b..464a22f45 100644 --- a/packages/web/src/javascripts/Components/Preferences/Panes/Security/TwoFactorAuth/TwoFactorAuthView/TwoFactorTitle.tsx +++ b/packages/web/src/javascripts/Components/Preferences/Panes/Security/TwoFactorAuth/TwoFactorAuthView/TwoFactorTitle.tsx @@ -11,9 +11,7 @@ const TwoFactorTitle: FunctionComponent = ({ auth }) => { if (!auth.isLoggedIn()) { return Two-factor authentication not available } - if (!auth.isMfaFeatureAvailable()) { - return Two-factor authentication not available - } + return Two-factor authentication } diff --git a/packages/web/src/javascripts/Components/Preferences/Providers/MfaProvider.ts b/packages/web/src/javascripts/Components/Preferences/Providers/MfaProvider.ts index 1c71464ef..9a002749c 100644 --- a/packages/web/src/javascripts/Components/Preferences/Providers/MfaProvider.ts +++ b/packages/web/src/javascripts/Components/Preferences/Providers/MfaProvider.ts @@ -8,6 +8,4 @@ export interface MfaProvider { enableMfa(secret: string, otpToken: string): Promise disableMfa(): Promise - - isMfaFeatureAvailable(): boolean }