Log out only if there is main auth key, but it isn't logged in.

This commit is contained in:
levlam 2022-05-02 21:41:04 +03:00
parent d95b20b631
commit 0d0b641ac6
2 changed files with 3 additions and 2 deletions

View File

@ -34,7 +34,8 @@ Global::~Global() = default;
void Global::log_out(Slice reason) {
CHECK(shared_config_ != nullptr);
if (!shared_config_->have_option("auth")) {
shared_config_->set_option_string("auth", reason);
LOG(ERROR) << reason;
// shared_config_->set_option_string("auth", reason);
}
}

View File

@ -231,7 +231,7 @@ void DcAuthManager::loop() {
}
auto main_dc = find_dc(main_dc_id_.get_raw_id());
if (!main_dc || main_dc->auth_key_state != AuthKeyState::OK) {
if (need_check_authorization_is_ok_) {
if (main_dc && need_check_authorization_is_ok_) {
G()->log_out("Authorization check failed in DcAuthManager");
}
VLOG(dc) << "Skip loop, because main DC is " << main_dc_id_ << ", main auth key state is "