Skip to content

Commit 9f81eb6

Browse files
committed
fix(qrlogin): fix AuthLoginTokenSuccess handling in Export method
AuthLoginTokenSuccess indicates successful authentication, not an error. Return empty token instead of error when login token was already accepted.
1 parent 7e2b58c commit 9f81eb6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

telegram/auth/qrlogin/qrlogin.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ func (q QR) Export(ctx context.Context, exceptIDs ...int64) (Token, error) {
5151
case *tg.AuthLoginToken:
5252
return NewToken(t.Token, t.Expires), nil
5353
case *tg.AuthLoginTokenSuccess:
54-
// Token was already accepted, but we're trying to export
55-
return Token{}, errors.New("login token already accepted")
54+
// Token was already accepted, authentication successful
55+
// Return empty token since no new token is needed
56+
return Token{}, nil
5657
case *tg.AuthLoginTokenMigrateTo:
5758
// Migration needed
5859
return Token{}, &MigrationNeededError{

0 commit comments

Comments
 (0)