Skip to content
This repository has been archived by the owner on Oct 24, 2024. It is now read-only.

Commit

Permalink
Addresses Haisheng's comments
Browse files Browse the repository at this point in the history
  • Loading branch information
vijetmahabaleshwar-okta committed Sep 3, 2020
1 parent 1456cb3 commit 7b4d702
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,7 @@

const constants = require('../util/constants');
const util = require('../util/util');
let options = {};
let cdnUrl = 'https://global.oktacdn.com/okta-signin-widget/4.4.1';

// This is used as PDV for widget after artifact promotion to CDN
if(process.env.NPM_TARBALL_URL) {
// Extract the version of sign-in widget from the NPM_TARBALL_URL variable
// The variable is of the format https:<artifactory_url>/@okta/okta-signin-widget-3.0.6.tgz
const url = process.env.NPM_TARBALL_URL;
const i = url.lastIndexOf('-');
const version = url.substring(i + 1, url.length - 4);
cdnUrl=`https://global.oktacdn.com/okta-signin-widget/${version}`;

// We also test i18n assets on CDN
options.language = 'fr';
options.i18n = {
fr: {
'primaryauth.title': 'Connectez-vous à Acme',
}
}
}
console.log(`Using CDN url - ${cdnUrl}`);
const cdnUrl = 'https://global.oktacdn.com/okta-signin-widget/4.4.1';

const serverOptions = {
issuer: constants.ISSUER,
Expand All @@ -42,8 +22,7 @@ const serverOptions = {
testing: {
disableHttpsCheck: constants.OKTA_TESTING_DISABLEHTTPSCHECK
},
cdnUrl: cdnUrl,
options: options
cdnUrl: cdnUrl
}

console.log('serverOptions', serverOptions);
Expand Down
10 changes: 6 additions & 4 deletions packages/oidc-middleware/test/e2e/specs/custom-login-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,17 @@ browser.waitForAngularEnabled(false);
describe('Custom login page', () => {
let server;
beforeEach(async () => {
let cdnUrl = 'https://global.oktacdn.com/okta-signin-widget/4.4.1';
let options = {};
let widgetVersion = '4.4.1';
const options = {};

// This is used as PDV for widget after artifact promotion to CDN
if(process.env.NPM_TARBALL_URL) {
// Extract the version of sign-in widget from the NPM_TARBALL_URL variable
// The variable is of the format https:<artifactory_url>/@okta/okta-signin-widget-3.0.6.tgz
const url = process.env.NPM_TARBALL_URL;
const i = url.lastIndexOf('-');
const version = url.substring(i + 1, url.length - 4);
cdnUrl=`https://global.oktacdn.com/okta-signin-widget/${version}`;
widgetVersion = url.substring(i + 1, url.length - 4);

// We also test i18n assets on CDN
options.language = 'fr';
options.i18n = {
Expand All @@ -38,6 +39,7 @@ describe('Custom login page', () => {
}
}
}
const cdnUrl = `https://global.oktacdn.com/okta-signin-widget/${widgetVersion}`;
console.log(`Using CDN url - ${cdnUrl}`);

const serverOptions = {
Expand Down

0 comments on commit 7b4d702

Please sign in to comment.