ApiKey Authentication cleanup

This commit is contained in:
Mark McDowall 2013-09-20 15:19:48 -07:00
commit de607e207b
8 changed files with 48 additions and 45 deletions

View file

@ -21,11 +21,8 @@ define(function () {
delete xhr.data;
}
if (xhr) {
if (!xhr.headers) {
xhr.headers = {};
}
xhr.headers["ApiKey"] = window.NzbDrone.ApiKey;
xhr.headers = xhr.headers || {};
xhr.headers['Authorization'] = window.NzbDrone.ApiKey;
}
return original.apply(this, arguments);

View file

@ -5,7 +5,7 @@ var statusText = $.ajax({
url : window.NzbDrone.ApiRoot + '/system/status',
async: false,
headers: {
ApiKey: window.NzbDrone.ApiKey
Authorization: window.NzbDrone.ApiKey
}
}).responseText;

View file

@ -62,7 +62,7 @@
</body>
<script type="text/javascript">
window.NzbDrone = {};
window.NzbDrone = window.NzbDrone || {};
window.NzbDrone.ApiKey = 'API_KEY';
</script>