Skip to content

Commit

Permalink
Don't use secure on testMode
Browse files Browse the repository at this point in the history
  • Loading branch information
hajoa committed Jul 31, 2023
1 parent d9b26df commit 17ea2e5
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/main/js/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,15 @@ export function withoutAngularFields(obj) {
return obj
}

export function isTestMode() {
return window.parent.location.href.indexOf("runner.html") > 0;
}
export function getBearerToken($cookies) {
return $cookies.get(BEARER_TOKEN_KEY);
}
export function setBearerToken($cookies, token) {
$cookies.put(BEARER_TOKEN_KEY, token, {domain: window.baseUrl, secure: true, samesite: 'strict'});
$cookies.put(BEARER_TOKEN_KEY, token, {domain: window.baseUrl, secure: !isTestMode(), samesite: 'strict'});
}
export function removeBearerToken($cookies) {
$cookies.remove(BEARER_TOKEN_KEY);
}

export function isTestMode() {
return window.parent.location.href.indexOf("runner.html") > 0;
}


0 comments on commit 17ea2e5

Please sign in to comment.