logdb #56
| @ -312,6 +312,8 @@ func (h *MenuHandlers) CheckBlockedStatus(ctx context.Context, sym string, input | |||||||
| 		return res, fmt.Errorf("missing session") | 		return res, fmt.Errorf("missing session") | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | 	res.FlagReset = append(res.FlagReset, flag_account_pin_reset) | ||||||
|  | 
 | ||||||
| 	selfPinReset, err := store.ReadEntry(ctx, sessionId, storedb.DATA_SELF_PIN_RESET) | 	selfPinReset, err := store.ReadEntry(ctx, sessionId, storedb.DATA_SELF_PIN_RESET) | ||||||
| 	if err == nil { | 	if err == nil { | ||||||
| 		pinResetValue, _ := strconv.ParseUint(string(selfPinReset), 0, 64) | 		pinResetValue, _ := strconv.ParseUint(string(selfPinReset), 0, 64) | ||||||
| @ -529,6 +531,7 @@ func (h *MenuHandlers) ConfirmPinChange(ctx context.Context, sym string, input [ | |||||||
| 		return res, fmt.Errorf("missing session") | 		return res, fmt.Errorf("missing session") | ||||||
| 	} | 	} | ||||||
| 	flag_pin_mismatch, _ := h.flagManager.GetFlag("flag_pin_mismatch") | 	flag_pin_mismatch, _ := h.flagManager.GetFlag("flag_pin_mismatch") | ||||||
|  | 	flag_account_pin_reset, _ := h.flagManager.GetFlag("flag_account_pin_reset") | ||||||
| 
 | 
 | ||||||
| 	if string(input) == "0" { | 	if string(input) == "0" { | ||||||
| 		res.FlagReset = append(res.FlagReset, flag_pin_mismatch) | 		res.FlagReset = append(res.FlagReset, flag_pin_mismatch) | ||||||
| @ -560,10 +563,13 @@ func (h *MenuHandlers) ConfirmPinChange(ctx context.Context, sym string, input [ | |||||||
| 		logg.ErrorCtxf(ctx, "failed to write DATA_ACCOUNT_PIN entry with", "key", storedb.DATA_ACCOUNT_PIN, "hashedPIN value", hashedTemporaryPin, "error", err) | 		logg.ErrorCtxf(ctx, "failed to write DATA_ACCOUNT_PIN entry with", "key", storedb.DATA_ACCOUNT_PIN, "hashedPIN value", hashedTemporaryPin, "error", err) | ||||||
| 		return res, err | 		return res, err | ||||||
| 	} | 	} | ||||||
| 	err = logdb.WriteLogEntry(ctx, sessionId, storedb.DATA_ACCOUNT_PIN, []byte(hashedTemporaryPin)) | 	// set the DATA_SELF_PIN_RESET as 0
 | ||||||
|  | 	err = store.WriteEntry(ctx, sessionId, storedb.DATA_SELF_PIN_RESET, []byte("0")) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		logg.DebugCtxf(ctx, "Failed to write hashed PIN db log entry", "key", storedb.DATA_ACCOUNT_PIN, "value", hashedTemporaryPin) | 		logg.ErrorCtxf(ctx, "failed to write DATA_SELF_PIN_RESET entry with", "key", storedb.DATA_SELF_PIN_RESET, "self PIN reset value", "0", "error", err) | ||||||
|  | 		return res, err | ||||||
| 	} | 	} | ||||||
|  | 	res.FlagReset = append(res.FlagReset, flag_account_pin_reset) | ||||||
| 
 | 
 | ||||||
| 	return res, nil | 	return res, nil | ||||||
| } | } | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user