Skip to content

Commit 5891cfe

Browse files
committed
Fix processing of "URL_EXPIRED" errors.
1 parent c929172 commit 5891cfe

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

td/telegram/LinkManager.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1643,6 +1643,9 @@ class RequestUrlAuthQuery final : public Td::ResultHandler {
16431643
!td_->dialog_manager_->on_get_dialog_error(dialog_id_, status, "RequestUrlAuthQuery")) {
16441644
LOG(INFO) << "Receive error for RequestUrlAuthQuery: " << status;
16451645
}
1646+
if (status.message() == "URL_EXPIRED" || status.message() == "URL_INVALID") {
1647+
return promise_.set_error(std::move(status));
1648+
}
16461649
promise_.set_value(td_api::make_object<td_api::loginUrlInfoOpen>(url_, false));
16471650
}
16481651
};

td/telegram/net/Session.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,7 @@ void Session::on_message_result_error(mtproto::MessageId message_id, int error_c
932932
}
933933

934934
// UNAUTHORIZED
935-
if (error_code == 401 && message != "SESSION_PASSWORD_NEEDED" && message != "URL_EXPIRED") {
935+
if (error_code == 401 && message != "SESSION_PASSWORD_NEEDED") {
936936
if (auth_data_.use_pfs() && message == CSlice("AUTH_KEY_PERM_EMPTY")) {
937937
LOG(INFO) << "Receive AUTH_KEY_PERM_EMPTY in session " << auth_data_.get_session_id() << " for auth key "
938938
<< auth_data_.get_tmp_auth_key().id();

0 commit comments

Comments
 (0)