...
 
Commits (4)
......@@ -49,7 +49,7 @@
</script>
<script type="module">
import { SIBBase } from 'https://unpkg.com/@startinblox/core@0.5';
import { SIBBase } from 'https://unpkg.com/@startinblox/core@0.6';
class TestComponent extends SIBBase {
async connectedCallback() {
......
......@@ -34,6 +34,5 @@ sib-auth sib-auth-provider {
sib-auth sib-auth-provider:hover {
display: flex;
flex
box-shadow: 8px 8px 16px 0 rgba(0, 0, 0, 0.2);
}
import 'https://unpkg.com/oidc-client@1.6';
import { SIBBase, Helpers } from 'https://unpkg.com/@startinblox/core@0.5';
import { SIBBase, Helpers } from 'https://unpkg.com/@startinblox/core@0.6';
const baseUrl = import.meta.url.replace(/\/[^/]*$/, '');
Helpers.importCSS(`${baseUrl}/sib-auth.css`);
class SIBAuth extends HTMLElement {
/**
......@@ -23,9 +26,11 @@ class SIBAuth extends HTMLElement {
* then we process the current OIDC state
*/
async connectedCallback() {
Helpers.importCSS('./sib-auth.css');
this.install();
this.processState();
if (this.getUser()) {
this.dispatchUserInfo(this.getUser());
}
}
/** @function
......@@ -219,6 +224,7 @@ class SIBAuth extends HTMLElement {
setUser(user) {
localStorage.setItem('oidc_user', JSON.stringify(user));
this.user = user;
this.dispatchUserInfo(user);
}
/** @function
......