fix(web): remove checking for MFA permissions as all users are permitted to MFA
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ type Props = {
|
||||
}
|
||||
|
||||
const TwoFactorSwitch: FunctionComponent<Props> = ({ auth }) => {
|
||||
if (!(auth.isLoggedIn() && auth.isMfaFeatureAvailable())) {
|
||||
if (!auth.isLoggedIn()) {
|
||||
return null
|
||||
}
|
||||
|
||||
|
||||
@@ -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>
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,4 @@ export interface MfaProvider {
|
||||
enableMfa(secret: string, otpToken: string): Promise<void>
|
||||
|
||||
disableMfa(): Promise<void>
|
||||
|
||||
isMfaFeatureAvailable(): boolean
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user