Compare commits

..

6 Commits

Author SHA1 Message Date
Alfred Kamanda
fe5772fb3b force a self PIN reset if the event that the PIN doesn't exist 2026-01-13 16:47:45 +03:00
Alfred Kamanda
82d0e588c9 set the flag_account_pin_reset flag if the PIN doesn't exist 2026-01-13 16:46:11 +03:00
89d3d19d77 Merge pull request 'use the ResetRoot config to clear the cache once a user quits' (#112) from cache-error-fix into master
Reviewed-on: #112
2025-12-09 10:29:37 +01:00
Alfred Kamanda
817b523135 Merge branch 'master' into cache-error-fix
Some checks failed
release / docker (push) Has been cancelled
2025-12-08 17:43:21 +03:00
e0e3d9b6cf Merge pull request 'mpesa-onramp-offramp' (#110) from mpesa-onramp-offramp into master
Reviewed-on: #110
2025-12-08 15:41:23 +01:00
Alfred Kamanda
2cabae1e74 use the ResetRoot config to clear the cache once a user quits
Some checks are pending
release / docker (push) Waiting to run
2025-12-08 17:29:13 +03:00
12 changed files with 23 additions and 9 deletions

View File

@@ -79,11 +79,12 @@ func main() {
pfp := path.Join(scriptDir, "pp.csv")
cfg := engine.Config{
Root: "root",
OutputSize: uint32(size),
FlagCount: uint32(128),
MenuSeparator: menuSeparator,
Root: "root",
OutputSize: uint32(size),
FlagCount: uint32(128),
MenuSeparator: menuSeparator,
ResetOnEmptyInput: true,
ResetRoot: true, // clear the cache once a user quits
}
if engineDebug {

View File

@@ -94,11 +94,12 @@ func main() {
pfp := path.Join(scriptDir, "pp.csv")
cfg := engine.Config{
Root: "root",
OutputSize: uint32(size),
FlagCount: uint32(128),
MenuSeparator: menuSeparator,
Root: "root",
OutputSize: uint32(size),
FlagCount: uint32(128),
MenuSeparator: menuSeparator,
ResetOnEmptyInput: true,
ResetRoot: true, // clear the cache once a user quits
}
if engineDebug {

View File

@@ -82,6 +82,7 @@ func main() {
MenuSeparator: menuSeparator,
EngineDebug: engineDebug,
ResetOnEmptyInput: true,
ResetRoot: true, // clear the cache once a user quits
}
menuStorageService := storage.NewMenuStorageService(conns)

View File

@@ -21,6 +21,7 @@ func (h *MenuHandlers) Authorize(ctx context.Context, sym string, input []byte)
flag_incorrect_pin, _ := h.flagManager.GetFlag("flag_incorrect_pin")
flag_account_authorized, _ := h.flagManager.GetFlag("flag_account_authorized")
flag_allow_update, _ := h.flagManager.GetFlag("flag_allow_update")
flag_account_pin_reset, _ := h.flagManager.GetFlag("flag_account_pin_reset")
pinInput := string(input)
@@ -33,7 +34,9 @@ func (h *MenuHandlers) Authorize(ctx context.Context, sym string, input []byte)
AccountPin, err := store.ReadEntry(ctx, sessionId, storedb.DATA_ACCOUNT_PIN)
if err != nil {
logg.ErrorCtxf(ctx, "failed to read AccountPin entry with", "key", storedb.DATA_ACCOUNT_PIN, "error", err)
return res, err
logg.InfoCtxf(ctx, "Setting the flag_account_pin_reset flag for the user to set their own PIN")
res.FlagSet = append(res.FlagSet, flag_account_pin_reset)
return res, nil
}
// verify that the user provided the correct PIN

View File

@@ -7,6 +7,7 @@ MOUT back 0
MOUT quit 9
HALT
RELOAD authorize_account
CATCH self_reset_pin flag_account_pin_reset 1
CATCH incorrect_pin flag_incorrect_pin 1
INCMP _ 0
INCMP quit 9

View File

@@ -7,6 +7,7 @@ MOUT quit 9
HALT
LOAD authorize_account 6
RELOAD authorize_account
CATCH self_reset_pin flag_account_pin_reset 1
CATCH incorrect_pin flag_incorrect_pin 1
INCMP _ 0
INCMP quit 9

View File

@@ -6,6 +6,7 @@ MOUT quit 9
HALT
LOAD authorize_account 6
RELOAD authorize_account
CATCH self_reset_pin flag_account_pin_reset 1
CATCH incorrect_pin flag_incorrect_pin 1
INCMP _ 0
INCMP quit 9

View File

@@ -6,6 +6,7 @@ MOUT quit 9
LOAD authorize_account 6
HALT
RELOAD authorize_account
CATCH self_reset_pin flag_account_pin_reset 1
CATCH incorrect_pin flag_incorrect_pin 1
INCMP _ 0
INCMP quit 9

View File

@@ -9,6 +9,7 @@ MOUT quit 9
LOAD authorize_account 6
HALT
RELOAD authorize_account
CATCH self_reset_pin flag_account_pin_reset 1
CATCH incorrect_pin flag_incorrect_pin 1
INCMP _ 0
INCMP quit 9

View File

@@ -7,6 +7,7 @@ MOUT quit 9
LOAD authorize_account 6
HALT
RELOAD authorize_account
CATCH self_reset_pin flag_account_pin_reset 1
CATCH incorrect_pin flag_incorrect_pin 1
INCMP _ 0
INCMP quit 9

View File

@@ -4,6 +4,7 @@ MOUT quit 9
LOAD authorize_account 6
HALT
RELOAD authorize_account
CATCH self_reset_pin flag_account_pin_reset 1
CATCH incorrect_pin flag_incorrect_pin 1
INCMP _ 0
INCMP quit 9

View File

@@ -4,6 +4,7 @@ MOUT quit 9
LOAD authorize_account 6
HALT
RELOAD authorize_account
CATCH self_reset_pin flag_account_pin_reset 1
CATCH incorrect_pin flag_incorrect_pin 1
INCMP _ 0
INCMP quit 9