i18n(server): password not correct

This commit is contained in:
Elian Doran
2026-04-13 18:21:41 +03:00
parent 9326751923
commit 203c725e0c
3 changed files with 7 additions and 2 deletions

View File

@@ -212,6 +212,9 @@
"button": "Login",
"sign_in_with_sso": "Sign in with {{ ssoIssuerName }}"
},
"password": {
"incorrect": "The password you entered is incorrect."
},
"set_password": {
"title": "Set Password",
"heading": "Set password",

View File

@@ -15,6 +15,7 @@ import etapiTokenService from "../../services/etapi_tokens.js";
import type { Request } from "express";
import totp from "../../services/totp";
import recoveryCodeService from "../../services/encryption/recovery_codes";
import { t } from "i18next";
/**
* @swagger
@@ -126,7 +127,7 @@ function loginToProtectedSession(req: Request) {
if (!passwordEncryptionService.verifyPassword(password)) {
return {
success: false,
message: "Given current password doesn't match hash"
message: t("password.incorrect")
};
}

View File

@@ -4,6 +4,7 @@ import myScryptService from "./my_scrypt.js";
import { randomSecureToken, toBase64 } from "../utils.js";
import passwordEncryptionService from "./password_encryption.js";
import { ChangePasswordResponse } from "@triliumnext/commons";
import { t } from "i18next";
function isPasswordSet() {
return !!sql.getValue("SELECT value FROM options WHERE name = 'passwordVerificationHash'");
@@ -17,7 +18,7 @@ function changePassword(currentPassword: string, newPassword: string): ChangePas
if (!passwordEncryptionService.verifyPassword(currentPassword)) {
return {
success: false,
message: "Given current password doesn't match hash"
message: t("password.incorrect")
};
}