From b6e4ba7ede0ae0aaf0856ba6dbe8c7e95d5b0f74 Mon Sep 17 00:00:00 2001 From: alfred-mk Date: Mon, 2 Sep 2024 17:08:57 +0300 Subject: [PATCH] Verify PIN using the one in the db --- internal/handlers/ussd/menuhandler.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/internal/handlers/ussd/menuhandler.go b/internal/handlers/ussd/menuhandler.go index b7789b0..be9fe73 100644 --- a/internal/handlers/ussd/menuhandler.go +++ b/internal/handlers/ussd/menuhandler.go @@ -262,12 +262,11 @@ func (h *Handlers) VerifyPin(ctx context.Context, sym string, input []byte) (res return res, err } - accountData, err := h.accountFileHandler.ReadAccountData() + AccountPin, err := h.db.Fetch([]byte(AccountPin)) if err != nil { return res, err } - - if bytes.Equal(input, []byte(accountData["AccountPIN"])) { + if bytes.Equal(input, AccountPin) { res.FlagSet = []uint32{flags["flag_valid_pin"]} res.FlagReset = []uint32{flags["flag_pin_mismatch"]} res.FlagSet = append(res.FlagSet, flags["flag_pin_set"])