mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-13 13:09:02 +08:00
WebView and Connect integration: implemented logout flow via /slicer/logout
This commit is contained in:
parent
850ac19167
commit
7204a0e77b
@ -636,6 +636,19 @@ void ConnectWebViewPanel::logout()
|
||||
{
|
||||
wxString script = L"window._prusaConnect_v1.logout()";
|
||||
run_script(script);
|
||||
|
||||
Plater* plater = wxGetApp().plater();
|
||||
m_browser->RunScript(wxString::Format(
|
||||
R"(
|
||||
console.log('Preparing login');
|
||||
window.fetch('/slicer/logout', {method: 'POST', headers: {Authorization: 'Bearer %s'}})
|
||||
.then((resp) => {
|
||||
console.log('Login resp', resp);
|
||||
resp.text().then((json) => console.log('Login resp body', json));
|
||||
});
|
||||
)",
|
||||
plater->get_user_account()->get_access_token()
|
||||
));
|
||||
}
|
||||
|
||||
void ConnectWebViewPanel::sys_color_changed()
|
||||
|
Loading…
x
Reference in New Issue
Block a user