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

Getting 401 on authentication attempt. #2956

Closed tilvin closed 4 months ago

tilvin commented 4 months ago

I am trying to use old Ruby gem, and having hard times to make it work. But i think my current issue is not related to Ruby lib "old-fashioned".

I authorized and using this lib, then i destroy my client (https://www.rubydoc.info/gems/tdlib-ruby/2.2.0/TD%2FClientMethods:destroy) and since that i can't login back.

client.request_qr_code_authentication(other_user_ids: nil).wait
-> getting link
client.confirm_qr_code_authentication(link: "tg://login?token=received link")
-> {"@type":"error","code":401,"message":"Unauthorized","@extra":"some extra"}.

Does anyone have any clue?

levlam commented 4 months ago

The method confirm_qr_code_authentication must be called by another logged in device to confirm authorization. You can't call it before compliting authorization.

tilvin commented 4 months ago

Yes, thank you, my issue was related to ruby lib desuetude , thank you, closing here.