add check for if public key exists,then explicitly set flag_account_created
Some checks failed
release / docker (push) Has been cancelled
Some checks failed
release / docker (push) Has been cancelled
This commit is contained in:
parent
30cb800450
commit
74c82de472
@ -242,6 +242,28 @@ func (h *MenuHandlers) CreateAccount(ctx context.Context, sym string, input []by
|
|||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (h *MenuHandlers) CheckAccountCreated(ctx context.Context, sym string, input []byte) (resource.Result, error) {
|
||||||
|
var res resource.Result
|
||||||
|
flag_account_created, _ := h.flagManager.GetFlag("flag_account_created")
|
||||||
|
|
||||||
|
store := h.userdataStore
|
||||||
|
|
||||||
|
sessionId, ok := ctx.Value("SessionId").(string)
|
||||||
|
if !ok {
|
||||||
|
return res, fmt.Errorf("missing session")
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err := store.ReadEntry(ctx, sessionId, storedb.DATA_PUBLIC_KEY)
|
||||||
|
if err != nil {
|
||||||
|
if !db.IsNotFound(err) {
|
||||||
|
return res, err
|
||||||
|
}
|
||||||
|
return res, nil
|
||||||
|
}
|
||||||
|
res.FlagSet = append(res.FlagSet, flag_account_created)
|
||||||
|
return res, nil
|
||||||
|
}
|
||||||
|
|
||||||
// ResetValidPin resets the flag_valid_pin flag.
|
// ResetValidPin resets the flag_valid_pin flag.
|
||||||
func (h *MenuHandlers) ResetValidPin(ctx context.Context, sym string, input []byte) (resource.Result, error) {
|
func (h *MenuHandlers) ResetValidPin(ctx context.Context, sym string, input []byte) (resource.Result, error) {
|
||||||
var res resource.Result
|
var res resource.Result
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
LOAD check_blocked_status 1
|
LOAD check_blocked_status 1
|
||||||
RELOAD check_blocked_status
|
RELOAD check_blocked_status
|
||||||
|
LOAD check_account_created 2
|
||||||
|
RELOAD check_account_created
|
||||||
CATCH blocked_account flag_account_blocked 1
|
CATCH blocked_account flag_account_blocked 1
|
||||||
CATCH select_language flag_language_set 0
|
CATCH select_language flag_language_set 0
|
||||||
CATCH terms flag_account_created 0
|
CATCH terms flag_account_created 0
|
||||||
|
Loading…
Reference in New Issue
Block a user