From 2f01444db1efaa9e07daa4bf1e8bda1ae942c363 Mon Sep 17 00:00:00 2001 From: Suherdy Yacob Date: Tue, 19 May 2026 18:36:28 +0700 Subject: [PATCH] refactor: replace custom hash utility with Sha1.hash for employee PIN verification --- static/src/app/services/pos_store.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/static/src/app/services/pos_store.js b/static/src/app/services/pos_store.js index 34c2447..a4d870d 100644 --- a/static/src/app/services/pos_store.js +++ b/static/src/app/services/pos_store.js @@ -1,9 +1,10 @@ +/* global Sha1 */ + import { patch } from "@web/core/utils/patch"; import { PosStore } from "@point_of_sale/app/services/pos_store"; import { _t } from "@web/core/l10n/translation"; import { NumberPopup } from "@point_of_sale/app/components/popups/number_popup/number_popup"; import { makeAwaitable } from "@point_of_sale/app/utils/make_awaitable_dialog"; -import { hash } from "@pos_hr/app/utils/hash"; patch(PosStore.prototype, { async setTableFromUi(table, orderUuid = null) { @@ -66,7 +67,7 @@ patch(PosStore.prototype, { return false; } - const hashedPin = hash(inputPin); + const hashedPin = Sha1.hash(inputPin); const allEmployees = this.models["hr.employee"].getAll(); const employee = allEmployees.find(emp => emp._pin === hashedPin);