Commit 1e213581 authored by Nicolas Mérigot's avatar Nicolas Mérigot

fix: little clean up

parent 82be47f1
Pipeline #1988 passed with stage
in 27 seconds
......@@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>SIB-OIDC test</title>
<script type="module" src="sib-oidc.js"></script>
<script type="module" src="../sib-oidc.js"></script>
</head>
<body>
<sib-auth
......@@ -24,18 +24,16 @@
reload.onclick = () => location.reload();
</script>
<script type='module'>
import { SIBBase } from 'https://unpkg.com/@startinblox/core@0.5';
<pre id="output"></pre>
<script>
sibOidc = document.querySelector('sib-auth');
class TestComponent extends SIBBase {
async connectedCallback() {
const user = await this.getUser();
this.innerHTML = JSON.stringify(user);
}
}
customElements.define('sib-test', TestComponent);
customElements.whenDefined('sib-auth').then(() => {
sibOidc.getUser().then(user => {
console.log(user);
output.textContent = JSON.stringify(user, null, 2);
});
});
</script>
<sib-test></sib-test>
</body>
</html>
......@@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>SIB-OIDC test</title>
<script type="module" src="sib-oidc.js"></script>
<script type="module" src="./sib-oidc.js"></script>
</head>
<body>
<sib-auth
......@@ -24,16 +24,18 @@
reload.onclick = () => location.reload();
</script>
<pre id="output"></pre>
<script>
sibOidc = document.querySelector('sib-auth');
<script type='module'>
import { SIBBase } from 'https://unpkg.com/@startinblox/core@0.5';
customElements.whenDefined('sib-auth').then(() => {
sibOidc.getUser().then(user => {
console.log(user);
output.textContent = JSON.stringify(user, null, 2);
});
});
class TestComponent extends SIBBase {
async connectedCallback() {
const user = await this.getUser();
this.innerHTML = JSON.stringify(user);
}
}
customElements.define('sib-test', TestComponent);
</script>
<sib-test></sib-test>
</body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment