diff --git a/packages/auth/assets/index.html b/packages/auth/assets/index.html index f96300c034467cf0572d31d3fbd2718b783de234..83305f4f7384ae60453227fd2d867a9b6552c213 100644 --- a/packages/auth/assets/index.html +++ b/packages/auth/assets/index.html @@ -2,7 +2,7 @@ <html> <head> <meta charset="UTF-8"> - <script type="module" id="vpu-auth-wc-src" src="bundle.js"></script> + <script type="module" id="vpu-auth-src" src="bundle.js"></script> </head> <body> diff --git a/packages/auth/src/utils.js b/packages/auth/src/utils.js deleted file mode 100644 index 2b6ad588dd7349984f205798233d56f78dc8e0a7..0000000000000000000000000000000000000000 --- a/packages/auth/src/utils.js +++ /dev/null @@ -1,9 +0,0 @@ -export const getAssetURL = (path) => { - const elm = document.getElementById('vpu-library-app-src'); - if (!elm) - return path; - const url = elm.src; - // newer browsers only - //var url = import.meta.url; - return new URL(path, url).href; -}; diff --git a/packages/auth/src/vpu-auth-demo.js b/packages/auth/src/vpu-auth-demo.js index 7558824b7f768cfa3db72ec5581fc1ecec448262..7bb3997fb8b4938de195880b8ed862b34e4e8734 100644 --- a/packages/auth/src/vpu-auth-demo.js +++ b/packages/auth/src/vpu-auth-demo.js @@ -3,7 +3,6 @@ import {html, LitElement} from 'lit-element'; import './vpu-auth'; import * as commonUtils from 'vpu-common/utils'; import bulmaCSSPath from "bulma/css/bulma.min.css"; -import * as utils from "./utils"; class AuthDemo extends LitElement { constructor() { @@ -28,7 +27,8 @@ class AuthDemo extends LitElement { } render() { - const bulmaCSS = utils.getAssetURL(bulmaCSSPath); + commonUtils.initAssetBaseURL('vpu-auth-src'); + const bulmaCSS = commonUtils.getAssetURL(bulmaCSSPath); return html` <link rel="stylesheet" href="${bulmaCSS}"> diff --git a/packages/auth/src/vpu-auth.js b/packages/auth/src/vpu-auth.js index 632e60e2449fb71b903027e431c1f18f24ff5395..1bfcb4c15efc6fc4ff38111068bd989d7d107021 100644 --- a/packages/auth/src/vpu-auth.js +++ b/packages/auth/src/vpu-auth.js @@ -4,7 +4,6 @@ import JSONLD from 'vpu-common/jsonld' import * as commonUtils from 'vpu-common/utils'; import 'vpu-common/vpu-icon.js'; import bulmaCSSPath from "bulma/css/bulma.min.css"; -import * as utils from "./utils"; /** * Keycloak auth web component @@ -298,7 +297,8 @@ class VPUAuth extends LitElement { } render() { - const bulmaCSS = utils.getAssetURL(bulmaCSSPath); + commonUtils.initAssetBaseURL('vpu-auth-src'); + const bulmaCSS = commonUtils.getAssetURL(bulmaCSSPath); return html` <link rel="stylesheet" href="${bulmaCSS}"> diff --git a/packages/auth/vendor/common b/packages/auth/vendor/common index 91947464b55c79c5b0aa2188f512e08ebc0be612..adbdf63736ba48eaf93ca06f83ee3652b7f85f12 160000 --- a/packages/auth/vendor/common +++ b/packages/auth/vendor/common @@ -1 +1 @@ -Subproject commit 91947464b55c79c5b0aa2188f512e08ebc0be612 +Subproject commit adbdf63736ba48eaf93ca06f83ee3652b7f85f12