Skip to content

Commit caae78e

Browse files
AYMENJDlevlam
authored andcommitted
Ignore authentication_token for bots.
1 parent 6271c88 commit caae78e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

td/telegram/AuthManager.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,7 +1269,7 @@ void AuthManager::on_log_out_result(NetQueryPtr &&net_query) {
12691269
auto r_log_out = fetch_result<telegram_api::auth_logOut>(std::move(net_query));
12701270
if (r_log_out.is_ok()) {
12711271
auto logged_out = r_log_out.move_as_ok();
1272-
if (!logged_out->future_auth_token_.empty()) {
1272+
if (!logged_out->future_auth_token_.empty() && !is_bot()) {
12731273
td_->option_manager_->set_option_string("authentication_token",
12741274
base64url_encode(logged_out->future_auth_token_.as_slice()));
12751275
}
@@ -1387,7 +1387,7 @@ void AuthManager::on_get_authorization(tl_object_ptr<telegram_api::auth_Authoriz
13871387
if (auth->setup_password_required_ && auth->otherwise_relogin_days_ > 0) {
13881388
td_->option_manager_->set_option_integer("otherwise_relogin_days", auth->otherwise_relogin_days_);
13891389
}
1390-
if (!auth->future_auth_token_.empty()) {
1390+
if (!auth->future_auth_token_.empty() && !is_bot()) {
13911391
td_->option_manager_->set_option_string("authentication_token",
13921392
base64url_encode(auth->future_auth_token_.as_slice()));
13931393
}

0 commit comments

Comments
 (0)