reset the incorrect PIN attempts to 0 when the PIN is reset

This commit is contained in:
Alfred Kamanda 2025-01-21 02:28:19 +03:00
parent 9c05e0b4a2
commit 4fb3474b51
Signed by: Alfred-mk
GPG Key ID: 7EA3D01708908703

View File

@ -467,7 +467,13 @@ func (h *MenuHandlers) ResetOthersPin(ctx context.Context, sym string, input []b
err = store.WriteEntry(ctx, string(blockedPhonenumber), storedb.DATA_ACCOUNT_PIN, []byte(hashedTmporaryPin))
if err != nil {
return res, nil
return res, err
}
err = store.WriteEntry(ctx, string(blockedPhonenumber), storedb.DATA_INCORRECT_PIN_ATTEMPTS, []byte(string("0")))
if err != nil {
logg.ErrorCtxf(ctx, "failed to reset incorrect PIN attempts", "key", storedb.DATA_INCORRECT_PIN_ATTEMPTS, "error", err)
return res, err
}
return res, nil