fix(web): remove checking for MFA permissions as all users are permitted to MFA

This commit is contained in:
Karol Sójko
2022-11-16 10:26:59 +01:00
parent 7d8e212cfe
commit ea40427e67
7 changed files with 3 additions and 45 deletions

View File

@@ -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()
}
}

View File

@@ -11,17 +11,7 @@ const TwoFactorDescription: FunctionComponent<Props> = ({ auth }) => {
if (!auth.isLoggedIn()) {
return <Text>Sign in or register for an account to configure 2FA.</Text>
}
if (!auth.isMfaFeatureAvailable()) {
return (
<Text>
A paid subscription plan is required to enable 2FA.{' '}
<a target="_blank" href="https://standardnotes.com/features">
Learn more
</a>
.
</Text>
)
}
return <Text>An extra layer of security when logging in to your account.</Text>
}

View File

@@ -9,7 +9,7 @@ type Props = {
}
const TwoFactorSwitch: FunctionComponent<Props> = ({ auth }) => {
if (!(auth.isLoggedIn() && auth.isMfaFeatureAvailable())) {
if (!auth.isLoggedIn()) {
return null
}

View File

@@ -11,9 +11,7 @@ const TwoFactorTitle: FunctionComponent<Props> = ({ auth }) => {
if (!auth.isLoggedIn()) {
return <Title>Two-factor authentication not available</Title>
}
if (!auth.isMfaFeatureAvailable()) {
return <Title>Two-factor authentication not available</Title>
}
return <Title>Two-factor authentication</Title>
}

View File

@@ -8,6 +8,4 @@ export interface MfaProvider {
enableMfa(secret: string, otpToken: string): Promise<void>
disableMfa(): Promise<void>
isMfaFeatureAvailable(): boolean
}