#91 authorization header in electron app

This commit is contained in:
Jan Prochazka
2021-04-23 20:39:08 +02:00
parent 73a1fce919
commit 9a2d56bfe4
4 changed files with 30 additions and 3 deletions

View File

@@ -20,3 +20,16 @@ export default function resolveApi() {
}
return window.location.origin;
}
export function resolveApiHeaders() {
if (window['require']) {
const electron = window['require']('electron');
if (electron) {
return {
Authorization: electron.remote.getGlobal('authorization'),
};
}
}
return {};
}