From dd0b0ce5a300f2503b940fd581ccec1db0d2e904 Mon Sep 17 00:00:00 2001 From: Carlosokumu Date: Thu, 29 Aug 2024 23:22:27 +0300 Subject: [PATCH] use authorize flag instead of unlock --- internal/handlers/ussd/menuhandler.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/internal/handlers/ussd/menuhandler.go b/internal/handlers/ussd/menuhandler.go index 0ffa209..872117a 100644 --- a/internal/handlers/ussd/menuhandler.go +++ b/internal/handlers/ussd/menuhandler.go @@ -59,14 +59,7 @@ func NewHandlers(path string, st *state.State) *Handlers { } } -// Define the regex pattern as a constant -const pinPattern = `^\d{4}$` -// isValidPIN checks whether the given input is a 4 digit number -func isValidPIN(pin string) bool { - match, _ := regexp.MatchString(pinPattern, pin) - return match -} // Define the regex pattern as a constant const pinPattern = `^\d{4}$` @@ -467,7 +460,7 @@ func (h *Handlers) Quit(ctx context.Context, sym string, input []byte) (resource l.AddDomain("default") res.Content = l.Get("Thank you for using Sarafu. Goodbye!") - res.FlagReset = append(res.FlagReset, models.USERFLAG_ACCOUNT_UNLOCKED) + res.FlagReset = append(res.FlagReset, models.USERFLAG_ACCOUNT_AUTHORIZED) return res, nil }