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 @@ ...@@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" /> <meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>SIB-OIDC test</title> <title>SIB-OIDC test</title>
<script type="module" src="sib-oidc.js"></script> <script type="module" src="../sib-oidc.js"></script>
</head> </head>
<body> <body>
<sib-auth <sib-auth
...@@ -24,18 +24,16 @@ ...@@ -24,18 +24,16 @@
reload.onclick = () => location.reload(); reload.onclick = () => location.reload();
</script> </script>
<script type='module'> <pre id="output"></pre>
import { SIBBase } from 'https://unpkg.com/@startinblox/core@0.5'; <script>
sibOidc = document.querySelector('sib-auth');
class TestComponent extends SIBBase { customElements.whenDefined('sib-auth').then(() => {
async connectedCallback() { sibOidc.getUser().then(user => {
const user = await this.getUser(); console.log(user);
this.innerHTML = JSON.stringify(user); output.textContent = JSON.stringify(user, null, 2);
} });
} });
customElements.define('sib-test', TestComponent);
</script> </script>
<sib-test></sib-test>
</body> </body>
</html> </html>
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" /> <meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>SIB-OIDC test</title> <title>SIB-OIDC test</title>
<script type="module" src="sib-oidc.js"></script> <script type="module" src="./sib-oidc.js"></script>
</head> </head>
<body> <body>
<sib-auth <sib-auth
...@@ -24,16 +24,18 @@ ...@@ -24,16 +24,18 @@
reload.onclick = () => location.reload(); reload.onclick = () => location.reload();
</script> </script>
<pre id="output"></pre> <script type='module'>
<script> import { SIBBase } from 'https://unpkg.com/@startinblox/core@0.5';
sibOidc = document.querySelector('sib-auth');
customElements.whenDefined('sib-auth').then(() => { class TestComponent extends SIBBase {
sibOidc.getUser().then(user => { async connectedCallback() {
console.log(user); const user = await this.getUser();
output.textContent = JSON.stringify(user, null, 2); this.innerHTML = JSON.stringify(user);
}); }
}); }
customElements.define('sib-test', TestComponent);
</script> </script>
<sib-test></sib-test>
</body> </body>
</html> </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