Commit 94d1519d authored by Jean-Baptiste's avatar Jean-Baptiste Committed by Clément

update: dispatch undefined data-src on logout

parent 31b2fb90
......@@ -17,7 +17,7 @@
<button id="reset">clear storage and set new URL</button>
<button id="reload">reload</button>
<sib-test>
<sib-test bind-user>
<button id="login">Se connecter</button>
<button id="logout">Se déconnecter</button>
<button id="stat">Status (console)</button>
......
......@@ -153,6 +153,8 @@ class SIBAuth extends HTMLElement {
*/
// eslint-disable-next-line class-methods-use-this
async dispatchUserInfo(id) {
id = await id;
console.log('dispath ' + id)
const processDOM = async () => {
const elements = document.querySelectorAll('[bind-user]');
elements.forEach(element => this.applyUser(element));
......@@ -219,7 +221,7 @@ class SIBAuth extends HTMLElement {
* Try to logout if favorite provider is set
*/
logout() {
auth.logout()
auth.logout().then(() => this.dispatchUserInfo())
}
/** @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