aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatar Amine Mouafik <amine@mouafik.fr>2019-11-27 22:02:18 +0700
committerLibravatar Amine Mouafik <amine@mouafik.fr>2019-11-27 22:02:18 +0700
commit7a0453ebd728092f05ee65abc1a7c3efdda168d1 (patch)
treef648f20a4edd9159761eeeb49323b836606e7b7f /src
parentRevert "Deprecate electron-rebuild, follow electron-builder suggestion" (diff)
downloadferdium-app-7a0453ebd728092f05ee65abc1a7c3efdda168d1.tar.gz
ferdium-app-7a0453ebd728092f05ee65abc1a7c3efdda168d1.tar.zst
ferdium-app-7a0453ebd728092f05ee65abc1a7c3efdda168d1.zip
#232 Remove default lock password behavior, allow empty password
Diffstat (limited to 'src')
-rw-r--r--src/components/auth/Locked.js2
-rw-r--r--src/config.js1
-rw-r--r--src/containers/auth/LockedScreen.js5
-rw-r--r--src/containers/settings/EditSettingsScreen.js4
-rw-r--r--src/i18n/locales/defaultMessages.json20
-rw-r--r--src/i18n/messages/src/components/auth/Locked.json20
6 files changed, 23 insertions, 29 deletions
diff --git a/src/components/auth/Locked.js b/src/components/auth/Locked.js
index 045621d0a..ca571f20e 100644
--- a/src/components/auth/Locked.js
+++ b/src/components/auth/Locked.js
@@ -4,7 +4,6 @@ import { observer } from 'mobx-react';
4import { defineMessages, intlShape } from 'react-intl'; 4import { defineMessages, intlShape } from 'react-intl';
5 5
6import Form from '../../lib/Form'; 6import Form from '../../lib/Form';
7import { required } from '../../helpers/validation-helpers';
8import Input from '../ui/Input'; 7import Input from '../ui/Input';
9import Button from '../ui/Button'; 8import Button from '../ui/Button';
10import Infobox from '../ui/Infobox'; 9import Infobox from '../ui/Infobox';
@@ -50,7 +49,6 @@ export default @observer class Locked extends Component {
50 password: { 49 password: {
51 label: this.context.intl.formatMessage(messages.passwordLabel), 50 label: this.context.intl.formatMessage(messages.passwordLabel),
52 value: '', 51 value: '',
53 validators: [required],
54 type: 'password', 52 type: 'password',
55 }, 53 },
56 }, 54 },
diff --git a/src/config.js b/src/config.js
index bd67aee6b..fba4d6c2f 100644
--- a/src/config.js
+++ b/src/config.js
@@ -31,7 +31,6 @@ export const DEVELOPMENT_TODOS_FRONTEND_URL = 'https://development--franz-todos.
31 31
32export const GA_ID = !isDevMode ? 'UA-74126766-10' : 'UA-74126766-12'; 32export const GA_ID = !isDevMode ? 'UA-74126766-10' : 'UA-74126766-12';
33 33
34export const DEFAULT_LOCK_PASSWORD = 'ferdi';
35export const KEEP_WS_LOADED_USID = '0a0aa000-0a0a-49a0-a000-a0a0a0a0a0a0'; 34export const KEEP_WS_LOADED_USID = '0a0aa000-0a0a-49a0-a000-a0a0a0a0a0a0';
36 35
37export const HIBERNATION_STRATEGIES = { 36export const HIBERNATION_STRATEGIES = {
diff --git a/src/containers/auth/LockedScreen.js b/src/containers/auth/LockedScreen.js
index 94285fb06..671f2ccaf 100644
--- a/src/containers/auth/LockedScreen.js
+++ b/src/containers/auth/LockedScreen.js
@@ -3,7 +3,6 @@ import PropTypes from 'prop-types';
3import { inject, observer } from 'mobx-react'; 3import { inject, observer } from 'mobx-react';
4import Locked from '../../components/auth/Locked'; 4import Locked from '../../components/auth/Locked';
5import SettingsStore from '../../stores/SettingsStore'; 5import SettingsStore from '../../stores/SettingsStore';
6import { DEFAULT_LOCK_PASSWORD } from '../../config';
7 6
8import { globalError as globalErrorPropType } from '../../prop-types'; 7import { globalError as globalErrorPropType } from '../../prop-types';
9 8
@@ -27,9 +26,7 @@ export default @inject('stores', 'actions') @observer class LockedScreen extends
27 26
28 let correctPassword = this.props.stores.settings.all.app.lockedPassword; 27 let correctPassword = this.props.stores.settings.all.app.lockedPassword;
29 if (!correctPassword) { 28 if (!correctPassword) {
30 // Lock feature was enabled but no password was set 29 correctPassword = '';
31 // Use default lock password so user can exit
32 correctPassword = DEFAULT_LOCK_PASSWORD;
33 } 30 }
34 31
35 if (String(password) === String(correctPassword)) { 32 if (String(password) === String(correctPassword)) {
diff --git a/src/containers/settings/EditSettingsScreen.js b/src/containers/settings/EditSettingsScreen.js
index 07efbb881..b64cd77be 100644
--- a/src/containers/settings/EditSettingsScreen.js
+++ b/src/containers/settings/EditSettingsScreen.js
@@ -10,7 +10,7 @@ import UserStore from '../../stores/UserStore';
10import TodosStore from '../../features/todos/store'; 10import TodosStore from '../../features/todos/store';
11import Form from '../../lib/Form'; 11import Form from '../../lib/Form';
12import { APP_LOCALES, SPELLCHECKER_LOCALES } from '../../i18n/languages'; 12import { APP_LOCALES, SPELLCHECKER_LOCALES } from '../../i18n/languages';
13import { DEFAULT_APP_SETTINGS, DEFAULT_LOCK_PASSWORD, HIBERNATION_STRATEGIES } from '../../config'; 13import { DEFAULT_APP_SETTINGS, HIBERNATION_STRATEGIES } from '../../config';
14import { config as spellcheckerConfig } from '../../features/spellchecker'; 14import { config as spellcheckerConfig } from '../../features/spellchecker';
15 15
16import { getSelectOptions } from '../../helpers/i18n-helpers'; 16import { getSelectOptions } from '../../helpers/i18n-helpers';
@@ -309,7 +309,7 @@ export default @inject('stores', 'actions') @observer class EditSettingsScreen e
309 lockedPassword: { 309 lockedPassword: {
310 label: intl.formatMessage(messages.lockPassword), 310 label: intl.formatMessage(messages.lockPassword),
311 value: settings.all.app.lockedPassword, 311 value: settings.all.app.lockedPassword,
312 default: DEFAULT_LOCK_PASSWORD, 312 default: '',
313 type: 'password', 313 type: 'password',
314 }, 314 },
315 scheduledDNDEnabled: { 315 scheduledDNDEnabled: {
diff --git a/src/i18n/locales/defaultMessages.json b/src/i18n/locales/defaultMessages.json
index 10092cd9e..e68ec41af 100644
--- a/src/i18n/locales/defaultMessages.json
+++ b/src/i18n/locales/defaultMessages.json
@@ -202,65 +202,65 @@
202 "defaultMessage": "!!!Locked", 202 "defaultMessage": "!!!Locked",
203 "end": { 203 "end": {
204 "column": 3, 204 "column": 3,
205 "line": 18 205 "line": 17
206 }, 206 },
207 "file": "src/components/auth/Locked.js", 207 "file": "src/components/auth/Locked.js",
208 "id": "locked.headline", 208 "id": "locked.headline",
209 "start": { 209 "start": {
210 "column": 12, 210 "column": 12,
211 "line": 15 211 "line": 14
212 } 212 }
213 }, 213 },
214 { 214 {
215 "defaultMessage": "!!!Ferdi is currently locked. Please unlock Ferdi with your password to see your messages.", 215 "defaultMessage": "!!!Ferdi is currently locked. Please unlock Ferdi with your password to see your messages.",
216 "end": { 216 "end": {
217 "column": 3, 217 "column": 3,
218 "line": 22 218 "line": 21
219 }, 219 },
220 "file": "src/components/auth/Locked.js", 220 "file": "src/components/auth/Locked.js",
221 "id": "locked.info", 221 "id": "locked.info",
222 "start": { 222 "start": {
223 "column": 8, 223 "column": 8,
224 "line": 19 224 "line": 18
225 } 225 }
226 }, 226 },
227 { 227 {
228 "defaultMessage": "!!!Password", 228 "defaultMessage": "!!!Password",
229 "end": { 229 "end": {
230 "column": 3, 230 "column": 3,
231 "line": 26 231 "line": 25
232 }, 232 },
233 "file": "src/components/auth/Locked.js", 233 "file": "src/components/auth/Locked.js",
234 "id": "locked.password.label", 234 "id": "locked.password.label",
235 "start": { 235 "start": {
236 "column": 17, 236 "column": 17,
237 "line": 23 237 "line": 22
238 } 238 }
239 }, 239 },
240 { 240 {
241 "defaultMessage": "!!!Unlock", 241 "defaultMessage": "!!!Unlock",
242 "end": { 242 "end": {
243 "column": 3, 243 "column": 3,
244 "line": 30 244 "line": 29
245 }, 245 },
246 "file": "src/components/auth/Locked.js", 246 "file": "src/components/auth/Locked.js",
247 "id": "locked.submit.label", 247 "id": "locked.submit.label",
248 "start": { 248 "start": {
249 "column": 21, 249 "column": 21,
250 "line": 27 250 "line": 26
251 } 251 }
252 }, 252 },
253 { 253 {
254 "defaultMessage": "!!!Password invalid", 254 "defaultMessage": "!!!Password invalid",
255 "end": { 255 "end": {
256 "column": 3, 256 "column": 3,
257 "line": 34 257 "line": 33
258 }, 258 },
259 "file": "src/components/auth/Locked.js", 259 "file": "src/components/auth/Locked.js",
260 "id": "locked.invalidCredentials", 260 "id": "locked.invalidCredentials",
261 "start": { 261 "start": {
262 "column": 22, 262 "column": 22,
263 "line": 31 263 "line": 30
264 } 264 }
265 } 265 }
266 ], 266 ],
diff --git a/src/i18n/messages/src/components/auth/Locked.json b/src/i18n/messages/src/components/auth/Locked.json
index 86b1cae90..407e70484 100644
--- a/src/i18n/messages/src/components/auth/Locked.json
+++ b/src/i18n/messages/src/components/auth/Locked.json
@@ -4,11 +4,11 @@
4 "defaultMessage": "!!!Locked", 4 "defaultMessage": "!!!Locked",
5 "file": "src/components/auth/Locked.js", 5 "file": "src/components/auth/Locked.js",
6 "start": { 6 "start": {
7 "line": 15, 7 "line": 14,
8 "column": 12 8 "column": 12
9 }, 9 },
10 "end": { 10 "end": {
11 "line": 18, 11 "line": 17,
12 "column": 3 12 "column": 3
13 } 13 }
14 }, 14 },
@@ -17,11 +17,11 @@
17 "defaultMessage": "!!!Ferdi is currently locked. Please unlock Ferdi with your password to see your messages.", 17 "defaultMessage": "!!!Ferdi is currently locked. Please unlock Ferdi with your password to see your messages.",
18 "file": "src/components/auth/Locked.js", 18 "file": "src/components/auth/Locked.js",
19 "start": { 19 "start": {
20 "line": 19, 20 "line": 18,
21 "column": 8 21 "column": 8
22 }, 22 },
23 "end": { 23 "end": {
24 "line": 22, 24 "line": 21,
25 "column": 3 25 "column": 3
26 } 26 }
27 }, 27 },
@@ -30,11 +30,11 @@
30 "defaultMessage": "!!!Password", 30 "defaultMessage": "!!!Password",
31 "file": "src/components/auth/Locked.js", 31 "file": "src/components/auth/Locked.js",
32 "start": { 32 "start": {
33 "line": 23, 33 "line": 22,
34 "column": 17 34 "column": 17
35 }, 35 },
36 "end": { 36 "end": {
37 "line": 26, 37 "line": 25,
38 "column": 3 38 "column": 3
39 } 39 }
40 }, 40 },
@@ -43,11 +43,11 @@
43 "defaultMessage": "!!!Unlock", 43 "defaultMessage": "!!!Unlock",
44 "file": "src/components/auth/Locked.js", 44 "file": "src/components/auth/Locked.js",
45 "start": { 45 "start": {
46 "line": 27, 46 "line": 26,
47 "column": 21 47 "column": 21
48 }, 48 },
49 "end": { 49 "end": {
50 "line": 30, 50 "line": 29,
51 "column": 3 51 "column": 3
52 } 52 }
53 }, 53 },
@@ -56,11 +56,11 @@
56 "defaultMessage": "!!!Password invalid", 56 "defaultMessage": "!!!Password invalid",
57 "file": "src/components/auth/Locked.js", 57 "file": "src/components/auth/Locked.js",
58 "start": { 58 "start": {
59 "line": 31, 59 "line": 30,
60 "column": 22 60 "column": 22
61 }, 61 },
62 "end": { 62 "end": {
63 "line": 34, 63 "line": 33,
64 "column": 3 64 "column": 3
65 } 65 }
66 } 66 }