Set master key
This commit is contained in:
parent
3bc7c28a97
commit
bdec8b842e
|
@ -15,7 +15,7 @@ import { VueInjector, Reflection } from 'ui';
|
||||||
import E2EEComponent from './E2EEComponent.vue';
|
import E2EEComponent from './E2EEComponent.vue';
|
||||||
import aes256 from 'aes256';
|
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 {
|
export default new class E2EE extends BuiltinModule {
|
||||||
|
|
||||||
|
@ -24,6 +24,11 @@ export default new class E2EE extends BuiltinModule {
|
||||||
this.master = this.encrypt(seed, 'temporarymasterkey');
|
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() {
|
get settingPath() {
|
||||||
return ['security', 'default', 'e2ee'];
|
return ['security', 'default', 'e2ee'];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue