set password from web trilium

This commit is contained in:
zadam
2021-12-29 23:37:12 +01:00
parent 4e31af8c84
commit f92016f9ec
16 changed files with 58 additions and 50 deletions

View File

@@ -85,14 +85,10 @@ function logoutFromProtectedSession() {
}
function token(req) {
const username = req.body.username;
const password = req.body.password;
const isUsernameValid = username === optionService.getOption('username');
const isPasswordValid = passwordEncryptionService.verifyPassword(password);
if (!isUsernameValid || !isPasswordValid) {
return [401, "Incorrect username/password"];
if (!passwordEncryptionService.verifyPassword(password)) {
return [401, "Incorrect password"];
}
const apiToken = new ApiToken({