...
 
Commits (2)
......@@ -31,6 +31,12 @@ class SIBAuth extends HTMLElement {
if (await this.getUserWebId()) {
this.dispatchUserInfo();
}
const session = await new Promise(a => auth.trackSession(a));
if (!session) return;
const timeout = session.idClaims.exp * 1000 - Date.now();
setTimeout(() => {
this.logout();
}, timeout);
}
/** @function
......@@ -219,7 +225,7 @@ class SIBAuth extends HTMLElement {
* @name login
* Try to login, if favorite provider is set, trigger login, if not, select provider
*/
async login() {
login() {
const favoriteProvider = this.getFavoriteProvider();
if (favoriteProvider) {
this.callProvider(favoriteProvider, 'login', this);
......