Skip to content

Commit

Permalink
Revert "SPE-2567: Login dialog starts with loading page to delete coo…
Browse files Browse the repository at this point in the history
…kies before first request."

This reverts commit 338a961.
  • Loading branch information
kocikdav authored and lukasmatena committed Dec 13, 2024
1 parent b5c9773 commit 77bb494
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 23 deletions.
22 changes: 1 addition & 21 deletions src/slic3r/GUI/WebViewDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -691,14 +691,10 @@ void PrintablesConnectUploadDialog::on_connect_action_close_dialog(const std::st
}

LoginWebViewDialog::LoginWebViewDialog(wxWindow *parent, std::string &ret_val, const wxString& url, wxEvtHandler* evt_handler)
: WebViewDialog(parent, GUI::format_wxstr("file://%1%/web/other_loading.html", boost::filesystem::path(resources_dir()).generic_string()), _L("Log in dialog"), wxSize(50 * wxGetApp().em_unit(), 80 * wxGetApp().em_unit()), {})
: WebViewDialog(parent, url, _L("Log in dialog"), wxSize(50 * wxGetApp().em_unit(), 80 * wxGetApp().em_unit()), {})
, m_ret_val(ret_val)
, p_evt_handler(evt_handler)
{
// Loading screen is sent to WebViewDialog constructor to first load.
// In on_loaded real url is requested.
// This gives us space to delete cookies before requesting login page. (So it is never logged in)
m_default_url = url;
Centre();
}
void LoginWebViewDialog::on_navigation_request(wxWebViewEvent &evt)
Expand Down Expand Up @@ -732,21 +728,5 @@ void LoginWebViewDialog::on_dpi_changed(const wxRect &suggested_rect)
Fit();
Refresh();
}

void LoginWebViewDialog::on_loaded(wxWebViewEvent &evt)
{
BOOST_LOG_TRIVIAL(debug) << "LoginWebViewDialog::on_loaded " << evt.GetURL();

if (!m_did_default_url_request && evt.GetURL().Find("/web/other_loading.html") != wxNOT_FOUND) {
m_did_default_url_request = true;
delete_cookies(m_browser, Utils::ServiceConfig::instance().account_url());
delete_cookies(m_browser, "https://accounts.google.com");
delete_cookies(m_browser, "https://appleid.apple.com");
delete_cookies(m_browser, "https://facebook.com");
m_browser->LoadURL(m_default_url);
return;
}

}
} // GUI
} // Slic3r
2 changes: 0 additions & 2 deletions src/slic3r/GUI/WebViewDialog.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,10 @@ class LoginWebViewDialog : public WebViewDialog
LoginWebViewDialog(wxWindow *parent, std::string &ret_val, const wxString& url, wxEvtHandler* evt_handler);
void on_navigation_request(wxWebViewEvent &evt) override;
void on_dpi_changed(const wxRect &suggested_rect) override;
void on_loaded(wxWebViewEvent &evt) override;
private:
std::string& m_ret_val;
wxEvtHandler* p_evt_handler;
bool m_evt_sent{ false };
bool m_did_default_url_request { false };
};

} // GUI
Expand Down

0 comments on commit 77bb494

Please sign in to comment.