tdlib / td

Cross-platform library for building Telegram clients
https://core.telegram.org/tdlib
Boost Software License 1.0
7.11k stars 1.44k forks source link

Unable to undo authorizationStateWaitOtherDeviceConfirmation #2433

Closed Fra078 closed 1 year ago

Fra078 commented 1 year ago

Using java, after sent command requestQrCodeAuthentication to display a qr code for login I'm unable to request phone number if the user change his mind and want to log in with phone number and code authentication

levlam commented 1 year ago

You can't call setAuthenticationPhoneNumber directly in the state authorizationStateWaitOtherDeviceConfirmation, because the other device can confirm authorization any time. It would be hard to distinguish, in what account the user was logged in. Instead, you need to call logOut, wait while the current authorization is canceled, and reopen the instance after the current instance closes.

Fra078 commented 1 year ago

Thanks, I was doing in this way but I thought it was wrong