Set master key

This commit is contained in:
Jiiks 2018-08-10 17:02:41 +03:00
parent 3bc7c28a97
commit bdec8b842e
1 changed files with 6 additions and 1 deletions

View File

@ -15,7 +15,7 @@ import { VueInjector, Reflection } from 'ui';
import E2EEComponent from './E2EEComponent.vue';
import aes256 from 'aes256';
const seed = Math.random().toString(36).replace(/[^a-z]+/g, '');
let seed = Math.random().toString(36).replace(/[^a-z]+/g, '');
export default new class E2EE extends BuiltinModule {
@ -24,6 +24,11 @@ export default new class E2EE extends BuiltinModule {
this.master = this.encrypt(seed, 'temporarymasterkey');
}
setMaster(key) {
seed = Math.random().toString(36).replace(/[^a-z]+/g, '');
this.master = this.encrypt(seed, key);
}
get settingPath() {
return ['security', 'default', 'e2ee'];
}