Password set, change and remove complete

pull/726/head
Vincent 5 years ago
parent 2439c6f95b
commit 35d59c75eb

@ -2151,6 +2151,36 @@
"description":
"Button action that the user can click to view their unique seed"
},
"setAccountPasswordTitle": {
"message": "Set Account Password",
"description":
"Prompt for user to set account password in settings view"
},
"setAccountPasswordDescription": {
"message": "Secure your account and public key with a password",
"description":
"Description for set account password setting view"
},
"changeAccountPasswordTitle": {
"message": "Change Account Password",
"description":
"Prompt for user to change account password in settings view"
},
"changeAccountPasswordDescription": {
"message": "Change your password",
"description":
"Description for change account password setting view"
},
"removeAccountPasswordTitle": {
"message": "Remove Account Password",
"description":
"Prompt for user to remove account password in settings view"
},
"removeAccountPasswordDescription": {
"message": "Remove the password associated with your account",
"description":
"Description for remove account password setting view"
},
"showSeedPasswordRequest": {
"message": "Please enter your password",
"description": "Request for user to enter password to show seed."

@ -26,6 +26,7 @@ window.Signal = Signal.setup({
window.passwordUtil = require('./app/password_util');
window.resetDatabase = () => {
window.log.info('reset database');
ipcRenderer.send('resetDatabase');

@ -127,7 +127,6 @@ window.onUnblockNumber = number => ipc.send('on-unblock-number', number);
ipc.on('mediaPermissionsChanged', () => {
Whisper.events.trigger('mediaPermissionsChanged');
W;
});
ipc.on('on-unblock-number', (event, number) => {
@ -401,7 +400,6 @@ window.libphonenumber.PhoneNumberFormat = require('google-libphonenumber').Phone
window.loadImage = require('blueimp-load-image');
window.getGuid = require('uuid/v4');
window.profileImages = require('./app/profile_images');
window.passwordUtil = require('./app/password_util');
window.React = require('react');
window.ReactDOM = require('react-dom');
@ -467,6 +465,11 @@ contextMenu({
},
});
// User config for managing password DB entries etc.
const thisfaw = require('./app/password_util');
console.log(thisfaw);
// We pull this in last, because the native module involved appears to be sensitive to
// /tmp mounted as noexec on Linux.
require('./js/spell_check');

@ -25,7 +25,7 @@ export class SessionConfirm extends React.Component<Props> {
closeTheme: SessionButtonColor.Primary,
hideCancel: false,
};
\
constructor(props: any) {
super(props);
}

@ -2,6 +2,7 @@ import React from 'react';
import { SettingsHeader } from './SessionSettingsHeader';
import { SessionSettingListItem } from './SessionSettingListItem';
import { SessionButtonColor } from '../SessionButton';
export enum SessionSettingCategory {
General = 'general',
@ -34,6 +35,9 @@ export class SettingsView extends React.Component<SettingsViewProps> {
public renderSettingInCategory() {
const { Settings } = window.Signal.Types;
//const hasPassword = window.userConfig.get('dbHasPassword');
//console.log(`User has password: ${hasPassword}`);
// Grab initial values from database on startup
// ID corresponds to instalGetter parameters in preload.js
// They are NOT arbitrary; add with caution
@ -122,6 +126,7 @@ export class SettingsView extends React.Component<SettingsViewProps> {
setFn: window.toggleMediaPermissions,
content: {},
},
{
id: 'message-ttl',
title: window.i18n('messageTTL'),
@ -132,6 +137,45 @@ export class SettingsView extends React.Component<SettingsViewProps> {
setFn: undefined,
content: {},
},
{
id: 'set-password',
title: window.i18n('setAccountPasswordTitle'),
description: window.i18n('setAccountPasswordDescription'),
hidden: false,
type: SessionSettingType.Button,
category: SessionSettingCategory.Privacy,
setFn: undefined,
content: {
buttonText: window.i18n('setPassword'),
buttonColor: SessionButtonColor.Primary,
},
},
{
id: 'change-password',
title: window.i18n('changeAccountPasswordTitle'),
description: window.i18n('changeAccountPasswordDescription'),
hidden: false,
type: SessionSettingType.Button,
category: SessionSettingCategory.Privacy,
setFn: undefined,
content: {
buttonText: window.i18n('changePassword'),
buttonColor: SessionButtonColor.Primary,
},
},
{
id: 'remove-password',
title: window.i18n('removeAccountPasswordTitle'),
description: window.i18n('removeAccountPasswordDescription'),
hidden: false,
type: SessionSettingType.Button,
category: SessionSettingCategory.Privacy,
setFn: undefined,
content: {
buttonText: window.i18n('removePassword'),
buttonColor: SessionButtonColor.Danger,
},
},
];
return (

1
ts/global.d.ts vendored

@ -5,6 +5,7 @@ interface Window {
mnemonic: any;
clipboard: any;
passwordUtil: any;
userConfig: any;
dcodeIO: any;
libsignal: any;
libloki: any;

Loading…
Cancel
Save