new message on login
This commit is contained in:
parent
3d9b0f1de7
commit
cee960fea0
9 changed files with 492 additions and 90 deletions
|
|
@ -228,6 +228,14 @@ func (r *Router) onAuthSendCode(ctx context.Context, req *tg.AuthSendCodeRequest
|
|||
return nil, err
|
||||
}
|
||||
r.rememberClientAPIID(ctx, req.APIID)
|
||||
if r.log != nil {
|
||||
normalized := domain.NormalizePhone(req.PhoneNumber)
|
||||
_, decodeOK := domain.DecodeEmailPhone(normalized)
|
||||
r.log.Info("auth.sendCode phone diagnostics",
|
||||
zap.Int("phone_len", len(normalized)),
|
||||
zap.Bool("looks_like_email_signup", domain.IsEmailSignupPhone(normalized)),
|
||||
zap.Bool("decodes_to_email", decodeOK))
|
||||
}
|
||||
hash, err := r.deps.Auth.SendCode(ctx, req.PhoneNumber)
|
||||
if err != nil {
|
||||
if errors.Is(err, auth.ErrPhoneNumberInvalid) ||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue