Skip to content

Commit

Permalink
change hardcoded strings to allow local dev
Browse files Browse the repository at this point in the history
  • Loading branch information
redallen committed Jan 27, 2021
1 parent 8a80dd2 commit de14093
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/js/jwt/insights/url.js
Expand Up @@ -11,7 +11,7 @@ export default (env) => {
return ssoEnv?.[1].sso;
} else {
log('SSO url: not found, defaulting to qa');
log('Current env: not found, defaultint to qa');
return 'https://sso.qa.redhat.com/auth';
log('Current env: not found, defaulting to qa');
return 'http://localhost:8180/auth';
}
};
7 changes: 5 additions & 2 deletions src/js/jwt/jwt.js
Expand Up @@ -102,7 +102,7 @@ export const init = (options) => {

const isBeta = window.location.pathname.split('/')[1] === 'beta' ? '/beta' : '';

options.silentCheckSsoRedirectUri = `https://${window.location.host}${isBeta}/silent-check-sso.html`;
options.silentCheckSsoRedirectUri = `${window.location.origin}${isBeta}/silent-check-sso.html`;

if (window.localStorage && window.localStorage.getItem('chrome:jwt:shortSession') === 'true') {
options.realm = 'short-session';
Expand Down Expand Up @@ -325,7 +325,10 @@ function getCookieExpires(exp) {
function setCookie(token) {
log('Setting the cs_jwt cookie');
if (token && token.length > 10) {
setCookieWrapper(`${priv.cookie.cookieName}=${token};` + `path=/;` + `secure=true;` + `expires=${getCookieExpires(decodeToken(token).exp)}`);
const cookieString = `${priv.cookie.cookieName}=${token};`
+ `path=/;`
+ `expires=${getCookieExpires(decodeToken(token).exp)}`;
setCookieWrapper(cookieString);
}
}

Expand Down

0 comments on commit de14093

Please sign in to comment.