removed redundant logs
This commit is contained in:
parent
297b2f6ffe
commit
1078e7abbb
|
@ -124,14 +124,14 @@ window.customElements.define('d4s-boot-2', class extends HTMLElement {
|
||||||
}).then(token => {
|
}).then(token => {
|
||||||
console.log("Authorized. Token exp: " + this.expirationDate(this.parseJwt(token).exp))
|
console.log("Authorized. Token exp: " + this.expirationDate(this.parseJwt(token).exp))
|
||||||
//transform all queued requests to fetches
|
//transform all queued requests to fetches
|
||||||
console.log("All pending requests to promises")
|
//console.log("All pending requests to promises")
|
||||||
let promises = this.#queue.map(r => {
|
let promises = this.#queue.map(r => {
|
||||||
r.request.headers["Authorization"] = "Bearer " + token
|
r.request.headers["Authorization"] = "Bearer " + token
|
||||||
return r.resolve( fetch(r.url, r.request) )
|
return r.resolve( fetch(r.url, r.request) )
|
||||||
})
|
})
|
||||||
//clear queue
|
//clear queue
|
||||||
this.#queue = []
|
this.#queue = []
|
||||||
console.log("Resolving all fetches")
|
//console.log("Resolving all fetches")
|
||||||
return Promise.all(promises)
|
return Promise.all(promises)
|
||||||
|
|
||||||
}).catch(err => console.error("Unable to make calls: " + err)) // Sometimes throws: Unable to make calls: TypeError: Cannot read properties of undefined (reading 'split')
|
}).catch(err => console.error("Unable to make calls: " + err)) // Sometimes throws: Unable to make calls: TypeError: Cannot read properties of undefined (reading 'split')
|
||||||
|
@ -177,7 +177,7 @@ window.customElements.define('d4s-boot-2', class extends HTMLElement {
|
||||||
} else {
|
} else {
|
||||||
req.headers = { "Authorization" : null}
|
req.headers = { "Authorization" : null}
|
||||||
}
|
}
|
||||||
console.log("Queued request to url ", url)
|
//console.log("Queued request to url ", url)
|
||||||
this.#queue.push({ url : url, request : req, resolve : resolve, reject : reject})
|
this.#queue.push({ url : url, request : req, resolve : resolve, reject : reject})
|
||||||
})
|
})
|
||||||
return p
|
return p
|
||||||
|
@ -202,7 +202,7 @@ window.customElements.define('d4s-boot-2', class extends HTMLElement {
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(json => {
|
.then(json => {
|
||||||
this.#config = json
|
this.#config = json
|
||||||
console.log("Keycloak uma2 configuration loaded")
|
//console.log("Keycloak uma2 configuration loaded")
|
||||||
resolve(true)
|
resolve(true)
|
||||||
})
|
})
|
||||||
.catch(err => reject("Failed to fetch uma2-configuration from server: " + err))
|
.catch(err => reject("Failed to fetch uma2-configuration from server: " + err))
|
||||||
|
|
Loading…
Reference in New Issue