mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-07-31 12:42:03 +08:00
Temporary sending session id instead of access key
This commit is contained in:
parent
5f48e61992
commit
93df0ce384
@ -67,6 +67,11 @@ std::string UserAccount::get_access_token()
|
|||||||
return m_communication->get_access_token();
|
return m_communication->get_access_token();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string UserAccount::get_shared_session_key()
|
||||||
|
{
|
||||||
|
return m_communication->get_shared_session_key();
|
||||||
|
}
|
||||||
|
|
||||||
boost::filesystem::path UserAccount::get_avatar_path(bool logged) const
|
boost::filesystem::path UserAccount::get_avatar_path(bool logged) const
|
||||||
{
|
{
|
||||||
if (logged) {
|
if (logged) {
|
||||||
|
@ -59,6 +59,7 @@ public:
|
|||||||
|
|
||||||
std::string get_username() const { return m_username; }
|
std::string get_username() const { return m_username; }
|
||||||
std::string get_access_token();
|
std::string get_access_token();
|
||||||
|
std::string get_shared_session_key();
|
||||||
const ConnectPrinterStateMap& get_printer_state_map() const { return m_printer_map; }
|
const ConnectPrinterStateMap& get_printer_state_map() const { return m_printer_map; }
|
||||||
boost::filesystem::path get_avatar_path(bool logged) const;
|
boost::filesystem::path get_avatar_path(bool logged) const;
|
||||||
|
|
||||||
|
@ -201,6 +201,14 @@ std::string UserAccountCommunication::get_access_token()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string UserAccountCommunication::get_shared_session_key()
|
||||||
|
{
|
||||||
|
{
|
||||||
|
std::lock_guard<std::mutex> lock(m_session_mutex);
|
||||||
|
return m_session->get_shared_session_key();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void UserAccountCommunication::set_polling_enabled(bool enabled)
|
void UserAccountCommunication::set_polling_enabled(bool enabled)
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
|
@ -60,6 +60,7 @@ public:
|
|||||||
|
|
||||||
std::string get_username() const { return m_username; }
|
std::string get_username() const { return m_username; }
|
||||||
std::string get_access_token();
|
std::string get_access_token();
|
||||||
|
std::string get_shared_session_key();
|
||||||
|
|
||||||
void set_polling_enabled(bool enabled);
|
void set_polling_enabled(bool enabled);
|
||||||
|
|
||||||
|
@ -500,8 +500,10 @@ void ConnectRequestHandler::on_request_config()
|
|||||||
language?: ConnectLanguage;
|
language?: ConnectLanguage;
|
||||||
sessionId?: string;
|
sessionId?: string;
|
||||||
*/
|
*/
|
||||||
const std::string token = wxGetApp().plater()->get_user_account()->get_access_token();
|
//const std::string token = wxGetApp().plater()->get_user_account()->get_access_token();
|
||||||
const std::string init_options = GUI::format("{\"accessToken\": \"%1%\" }", token);
|
//const std::string init_options = GUI::format("{\"accessToken\": \"%1%\" }", token);
|
||||||
|
const std::string token = wxGetApp().plater()->get_user_account()->get_shared_session_key();
|
||||||
|
const std::string init_options = GUI::format("{\"sessionId\": \"%1%\" }", token);
|
||||||
wxString script = GUI::format_wxstr("window._prusaConnect_v1.init(%1%)", init_options);
|
wxString script = GUI::format_wxstr("window._prusaConnect_v1.init(%1%)", init_options);
|
||||||
run_script_bridge(script);
|
run_script_bridge(script);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user