hash the PIN in TestAuthorize

This commit is contained in:
Alfred Kamanda 2025-01-02 14:38:22 +03:00
parent 98db85511b
commit 82b4365d16
Signed by untrusted user: Alfred-mk
GPG Key ID: 7EA3D01708908703

View File

@ -1047,7 +1047,14 @@ func TestAuthorize(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
err = store.WriteEntry(ctx, sessionId, common.DATA_ACCOUNT_PIN, []byte(accountPIN))
// Hash the PIN
hashedPIN, err := common.HashPIN(accountPIN)
if err != nil {
logg.ErrorCtxf(ctx, "failed to hash temporaryPin", "error", err)
t.Fatal(err)
}
err = store.WriteEntry(ctx, sessionId, common.DATA_ACCOUNT_PIN, []byte(hashedPIN))
if err != nil {
t.Fatal(err)
}