From 4fb3474b51757c3c4d637e81df68d25565a06a49 Mon Sep 17 00:00:00 2001 From: alfred-mk Date: Tue, 21 Jan 2025 02:28:19 +0300 Subject: [PATCH] reset the incorrect PIN attempts to 0 when the PIN is reset --- handlers/application/menuhandler.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/handlers/application/menuhandler.go b/handlers/application/menuhandler.go index 751573e..a4e1fed 100644 --- a/handlers/application/menuhandler.go +++ b/handlers/application/menuhandler.go @@ -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