1
0
mirror of https://github.com/beestat/app.git synced 2025-05-24 02:14:03 -04:00

Fixed #341 - Beestat Stays Signed-In to Previous Account

This commit is contained in:
Jon Ziebell 2023-01-24 19:20:21 -05:00
parent dff338b580
commit 1c94dc8f09
4 changed files with 10 additions and 9 deletions

View File

@ -322,7 +322,7 @@ final class request {
'ip_address' => ip2long($_SERVER['REMOTE_ADDR']),
'timestamp' => date('Y-m-d H:i:s', intval($this->begin_timestamp)),
'request' => $this->request,
'response' => ($user['debug'] === true) ? $this->response : null,
'response' => ($user !== null && $user['debug'] === true) ? $this->response : null,
'total_time' => $this->total_time,
'query_count' => $database->get_query_count(),
'query_time' => $database->get_query_time(),

View File

@ -138,7 +138,9 @@ class user extends cora\crud {
return;
}
return $this->session->delete();
$this->session->delete();
header('Location: https://auth.ecobee.com/logout?federated&client_id=' . $this->setting->get('ecobee_client_id') . '&returnTo=' . str_replace('app.', '', $this->setting->get('beestat_root_uri')));
}
/**

View File

@ -25,7 +25,7 @@
// If you're not logged in, just take you directly to the ecobee login page.
if(isset($_COOKIE['session_key']) === false) {
header('Location: http://' . $_SERVER['HTTP_HOST'] . '/api/?resource=ecobee&method=authorize&arguments={}&api_key=' . $setting->get('beestat_api_key_local'));
header('Location: https://' . $_SERVER['HTTP_HOST'] . '/api/?resource=ecobee&method=authorize&arguments={}&api_key=' . $setting->get('beestat_api_key_local'));
die();
}

View File

@ -196,11 +196,10 @@ beestat.component.header.prototype.decorate_ = function(parent) {
.set_text('Log Out')
.set_icon('exit_to_app')
.set_callback(function() {
new beestat.api()
.set_callback(function() {
window.location.href = window.location.href.replace('app.', '');
})
.add_call('user', 'log_out')
.send();
window.location.replace(
window.location.href +
'api/?resource=user&method=log_out&arguments={}&api_key=' +
window.beestat_api_key_local
);
}));
};