Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: disabled 2fa feature #631

Merged
merged 7 commits into from
Sep 9, 2021
Merged

Conversation

gorjan5sk
Copy link
Contributor

  • use new snjs mfa method to check if 2fa feature is available

@@ -18,7 +18,8 @@ export const PreferencesViewWrapper: FunctionComponent<PreferencesViewWrapperPro
<PreferencesView
closePreferences={() => appState.preferences.closePreferences()}
application={application}
mfaGateway={application}
mfaProvider={application}
userProvider={application}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use 2 separate types for mfaProvider and userProvider but pass the same application object to them. Probably it's better to either use one prop for application with appropriate name or pass application's respective fields to mfaProvider and userProvider (e.g., pass only application.getUser to userProvider)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separation of concerns. We can test components that only depend on x:getUser(), that only depend on MfaProvider stuff, without mocking the whole WebApplication along with the kitchen sink :D

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks very strange tbh :D But I think we'll have better (practical) understanding of pros and cons of this approach only after writing some tests :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They're coming! :D
Can I get an approval now? :)

@@ -11,7 +11,7 @@ export const is2FADisabled = (s: TwoFactorStatus): s is 'two-factor-disabled' =>
s === 'two-factor-disabled';

export const is2FAActivation = (s: TwoFactorStatus): s is TwoFactorActivation =>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use more meaningful name for s :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@gorjan5sk gorjan5sk merged commit 7b1499d into develop Sep 9, 2021
@gorjan5sk gorjan5sk deleted the feature/2fa-disabling-features branch September 9, 2021 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants