account-pin-block-v2 #256
@ -747,7 +747,7 @@ func (h *Handlers) Authorize(ctx context.Context, sym string, input []byte) (res
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
err := h.countIncorrectPINAttempts(ctx, sessionId)
|
err := h.incrementIncorrectPINAttempts(ctx, sessionId)
|
||||||
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return res, err
|
return res, err
|
||||||
}
|
}
|
||||||
@ -884,7 +884,7 @@ func (h *Handlers) ShowBlockedAccount(ctx context.Context, sym string, input []b
|
|||||||
code := codeFromCtx(ctx)
|
code := codeFromCtx(ctx)
|
||||||
l := gotext.NewLocale(translationDir, code)
|
l := gotext.NewLocale(translationDir, code)
|
||||||
l.AddDomain("default")
|
l.AddDomain("default")
|
||||||
res.Content = l.Get("Your account has been locked.For help on how to unblock your account,contact support at: 0757628885")
|
res.Content = l.Get("Your account has been locked.For help on how to unblock your account, contact support at: 0757628885")
|
||||||
lash
commented
Space after punctuation Space after punctuation
|
|||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2124,8 +2124,8 @@ func (h *Handlers) UpdateAllProfileItems(ctx context.Context, sym string, input
|
|||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// countIncorrectPINAttempts keeps track of the number of incorrect PIN attempts
|
// incrementIncorrectPINAttempts keeps track of the number of incorrect PIN attempts
|
||||||
func (h *Handlers) countIncorrectPINAttempts(ctx context.Context, sessionId string) error {
|
func (h *Handlers) incrementIncorrectPINAttempts(ctx context.Context, sessionId string) error {
|
||||||
var pinAttemptsCount uint8
|
var pinAttemptsCount uint8
|
||||||
store := h.userdataStore
|
store := h.userdataStore
|
||||||
|
|
||||||
|
@ -2247,7 +2247,7 @@ func TestCountIncorrectPINAttempts(t *testing.T) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
t.Logf(err.Error())
|
t.Logf(err.Error())
|
||||||
}
|
}
|
||||||
err = h.countIncorrectPINAttempts(ctx, sessionId)
|
err = h.incrementIncorrectPINAttempts(ctx, sessionId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Logf(err.Error())
|
t.Logf(err.Error())
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user
perhaps
increment
notcount
?