Skip to content
Snippets Groups Projects
Commit 43e4174e authored by Benedikt Heinrichs's avatar Benedikt Heinrichs
Browse files

Node compatability

parent 5b28d3c4
No related branches found
No related tags found
1 merge request!4Update: Handle LocalStorage Coscine Values (coscine/issues#1833)
......@@ -66,11 +66,13 @@ namespace Coscine.CodeGen.CodeGenerator
if (typeof coscine !== 'undefined' && typeof coscine.authorization !== 'undefined') {
accessToken = 'Bearer ' + coscine.authorization.bearer;
}
if (typeof window !== 'undefined') {
// LocalStorage > Global Variables
const localStorageToken = localStorage.getItem('coscine.authorization.bearer');
if (localStorageToken) {
accessToken = 'Bearer ' + localStorageToken;
}
}
const getHostName = () => {
let hostName = typeof window !== 'undefined' ? window.location.hostname : 'coscine.rwth-aachen.de';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment