diff --git a/index.php b/index.php
index 48851bf..e039440 100644
--- a/index.php
+++ b/index.php
@@ -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=ER9Dz8t05qUdui0cvfWi5GiVVyHP6OB8KPuSisP2');
+ header('Location: http://' . $_SERVER['HTTP_HOST'] . '/api/?resource=ecobee&method=authorize&arguments={}&api_key=' . $setting->get('beestat_api_key_local'));
die();
}
diff --git a/js/beestat/api.js b/js/beestat/api.js
index 9ef88fc..9fad6bd 100644
--- a/js/beestat/api.js
+++ b/js/beestat/api.js
@@ -9,13 +9,6 @@ beestat.api = function() {
*/
beestat.api.cache = {};
-/**
- * Beestat's local API key.
- *
- * @type {string}
- */
-beestat.api.api_key = 'ER9Dz8t05qUdui0cvfWi5GiVVyHP6OB8KPuSisP2';
-
/**
* Send an API call. If the api_call parameter is specified it will send that.
* If not, it will check the cache, then construct and send the appropriate
@@ -33,7 +26,7 @@ beestat.api.prototype.send = function(opt_api_call) {
// If passing an actual API call, fire it off!
if (opt_api_call !== undefined) {
// Add in the API key
- opt_api_call.api_key = beestat.api.api_key;
+ opt_api_call.api_key = window.beestat_api_key_local;
this.xhr_.addEventListener('load', function() {
self.load_(this.responseText);
diff --git a/js/component/card/contribute_status.js b/js/component/card/contribute_status.js
index ad6c961..f291e9b 100644
--- a/js/component/card/contribute_status.js
+++ b/js/component/card/contribute_status.js
@@ -219,7 +219,7 @@ beestat.component.card.contribute_status.prototype.decorate_patreon_ = function(
.set_background_hover_color(beestat.style.color.red.light)
.set_text_color('#fff')
.addEventListener('click', function() {
- window.open('../api/?resource=patreon&method=authorize&arguments={}&api_key=ER9Dz8t05qUdui0cvfWi5GiVVyHP6OB8KPuSisP2');
+ window.open('../api/?resource=patreon&method=authorize&arguments={}&api_key=' + window.beestat_api_key_local);
self.state_.patreon_connecting = true;
self.rerender();
});
diff --git a/js/js.php b/js/js.php
index 1c07f60..6328b1b 100755
--- a/js/js.php
+++ b/js/js.php
@@ -4,6 +4,7 @@ require_once 'api/cora/setting.php';
$setting = cora\setting::get_instance();
// Make the environment accessible to JavaScript.
+echo '';
echo '';
echo '';