login: allow retrying phone codes and 2fa passwords (#131)

This commit is contained in:
Tulir Asokan
2026-02-10 16:49:49 +02:00
committed by GitHub
parent 4071502854
commit e597eace68
3 changed files with 51 additions and 22 deletions
+1 -1
View File
@@ -112,7 +112,7 @@ func (c *Client) SignIn(ctx context.Context, phone, code, codeHash string) (*tg.
return nil, ErrPasswordAuthNeeded
}
if tgerr.Is(err, "PHONE_CODE_INVALID") {
return nil, ErrPasswordAuthNeeded
return nil, ErrPhoneCodeInvalid
}
if err != nil {
return nil, errors.Wrap(err, "sign in")