From 315728415b2269981a04ee51af7ef18412d7bf70 Mon Sep 17 00:00:00 2001 From: Willy Woitas Date: Sun, 18 Feb 2024 01:49:42 +0100 Subject: feat: Parse 2FA SMS token and copy to clipboard (#1561) --- src/containers/settings/EditSettingsScreen.tsx | 37 ++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'src/containers/settings') diff --git a/src/containers/settings/EditSettingsScreen.tsx b/src/containers/settings/EditSettingsScreen.tsx index 272297700..5d1b09296 100644 --- a/src/containers/settings/EditSettingsScreen.tsx +++ b/src/containers/settings/EditSettingsScreen.tsx @@ -99,6 +99,16 @@ const messages = defineMessages({ id: 'settings.app.form.notifyTaskBarOnMessage', defaultMessage: 'Notify TaskBar/Dock on new message', }, + isTwoFactorAutoCatcherEnabled: { + id: 'settings.app.form.isTwoFactorAutoCatcherEnabled', + defaultMessage: + 'Auto-catch two-factor codes from notifications (Ex.: android messages) and copy to clipboard', + }, + twoFactorAutoCatcherMatcher: { + id: 'settings.app.form.twoFactorAutoCatcherMatcher', + defaultMessage: + 'Comma-separated and case-insensitive words/expressions to catch two-factor codes from. Ex.: token, code, sms, verify', + }, navigationBarBehaviour: { id: 'settings.app.form.navigationBarBehaviour', defaultMessage: 'Navigation bar behaviour', @@ -383,6 +393,10 @@ class EditSettingsScreen extends Component< privateNotifications: Boolean(settingsData.privateNotifications), clipboardNotifications: Boolean(settingsData.clipboardNotifications), notifyTaskBarOnMessage: Boolean(settingsData.notifyTaskBarOnMessage), + isTwoFactorAutoCatcherEnabled: Boolean( + settingsData.isTwoFactorAutoCatcherEnabled, + ), + twoFactorAutoCatcherMatcher: settingsData.twoFactorAutoCatcherMatcher, navigationBarBehaviour: settingsData.navigationBarBehaviour, webRTCIPHandlingPolicy: settingsData.webRTCIPHandlingPolicy, searchEngine: settingsData.searchEngine, @@ -680,6 +694,23 @@ class EditSettingsScreen extends Component< default: DEFAULT_APP_SETTINGS.notifyTaskBarOnMessage, type: 'checkbox', }, + isTwoFactorAutoCatcherEnabled: { + label: intl.formatMessage(messages.isTwoFactorAutoCatcherEnabled), + value: ifUndefined( + settings.all.app.isTwoFactorAutoCatcherEnabled, + DEFAULT_APP_SETTINGS.isTwoFactorAutoCatcherEnabled, + ), + default: DEFAULT_APP_SETTINGS.isTwoFactorAutoCatcherEnabled, + type: 'checkbox', + }, + twoFactorAutoCatcherMatcher: { + label: intl.formatMessage(messages.twoFactorAutoCatcherMatcher), + value: ifUndefined( + settings.all.app.twoFactorAutoCatcherMatcher, + DEFAULT_APP_SETTINGS.twoFactorAutoCatcherMatcher, + ), + default: DEFAULT_APP_SETTINGS.twoFactorAutoCatcherMatcher, + }, navigationBarBehaviour: { label: intl.formatMessage(messages.navigationBarBehaviour), value: ifUndefined( @@ -1257,6 +1288,12 @@ class EditSettingsScreen extends Component< this.props.stores.settings.app.useGrayscaleServices } isSplitModeEnabled={this.props.stores.settings.app.splitMode} + isTwoFactorAutoCatcherEnabled={ + this.props.stores.settings.app.isTwoFactorAutoCatcherEnabled + } + twoFactorAutoCatcherMatcher={ + this.props.stores.settings.app.twoFactorAutoCatcherMatcher + } isTodosActivated={this.props.stores.todos.isFeatureEnabledByUser} openProcessManager={() => this.openProcessManager()} isOnline={app.isOnline} -- cgit v1.2.3-54-g00ecf