Commit 454919fe authored by Matthieu Fesselier's avatar Matthieu Fesselier

fix bind user - issue #15

parent 9ce7e6ce
Pipeline #2878 failed with stage
in 49 seconds
......@@ -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';
const base_url = import.meta.url.replace(/\/[^\/]*$/, '');
Helpers.importCSS(`${base_url}/sib-auth.css`)
class SIBAuth extends HTMLElement {
/**
* @typedef {Object} State
......@@ -23,9 +26,10 @@ 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 +223,7 @@ class SIBAuth extends HTMLElement {
setUser(user) {
localStorage.setItem('oidc_user', JSON.stringify(user));
this.user = user;
this.dispatchUserInfo(user)
}
/** @function
......
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