We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8f480d0 commit a0dbf8cCopy full SHA for a0dbf8c
src/api-umbrella/admin-ui/app/instance-initializers/jquery-ajax.js
@@ -4,9 +4,17 @@ export function initialize(appInstance) {
4
const session = appInstance.lookup('service:session');
5
$.ajaxPrefilter(function(options) {
6
const data = session.get('data.authenticated');
7
- options.headers = options.headers || {};
8
- options.headers['X-Api-Key'] = data.api_key;
9
- options.headers['X-Admin-Auth-Token'] = data.admin_auth_token;
+ if(data) {
+ options.headers = options.headers || {};
+
10
+ if(data.api_key) {
11
+ options.headers['X-Api-Key'] = data.api_key;
12
+ }
13
14
+ if(data.admin_auth_token) {
15
+ options.headers['X-Admin-Auth-Token'] = data.admin_auth_token;
16
17
18
});
19
}
20
0 commit comments