mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 02:16:05 +01:00 
			
		
		
		
	resetting/setting password from options
This commit is contained in:
		| @@ -1,6 +1,4 @@ | ||||
| const optionService = require('./options'); | ||||
| const passwordEncryptionService = require('./password_encryption'); | ||||
| const myScryptService = require('./my_scrypt'); | ||||
| const appInfo = require('./app_info'); | ||||
| const utils = require('./utils'); | ||||
| const log = require('./log'); | ||||
| @@ -12,19 +10,6 @@ function initDocumentOptions() { | ||||
|     optionService.createOption('documentSecret', utils.randomSecureToken(16), false); | ||||
| } | ||||
|  | ||||
| function initPassword(password) { | ||||
|     optionService.createOption('passwordVerificationSalt', utils.randomSecureToken(32), true); | ||||
|     optionService.createOption('passwordDerivedKeySalt', utils.randomSecureToken(32), true); | ||||
|  | ||||
|     const passwordVerificationKey = utils.toBase64(myScryptService.getVerificationHash(password), true); | ||||
|     optionService.createOption('passwordVerificationHash', passwordVerificationKey, true); | ||||
|  | ||||
|     // passwordEncryptionService expects these options to already exist | ||||
|     optionService.createOption('encryptedDataKey', '', true); | ||||
|  | ||||
|     passwordEncryptionService.setDataKey(password, utils.randomSecureToken(16), true); | ||||
| } | ||||
|  | ||||
| function initNotSyncedOptions(initialized, opts = {}) { | ||||
|     optionService.createOption('openTabs', JSON.stringify([ | ||||
|         { | ||||
| @@ -127,7 +112,6 @@ function getKeyboardDefaultOptions() { | ||||
|  | ||||
| module.exports = { | ||||
|     initDocumentOptions, | ||||
|     initPassword, | ||||
|     initNotSyncedOptions, | ||||
|     initStartupOptions | ||||
| }; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user