mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-11 19:36:35 +00:00
Fix external auth reconnection loop if connection lost after refresh token expiration (#8279)
This commit is contained in:
parent
566ffe24a4
commit
bd59c4fccf
@ -68,8 +68,14 @@ export class ExternalAuth extends Auth {
|
|||||||
|
|
||||||
public async refreshAccessToken(force?: boolean) {
|
public async refreshAccessToken(force?: boolean) {
|
||||||
if (this._tokenCallbackPromise && !force) {
|
if (this._tokenCallbackPromise && !force) {
|
||||||
|
try {
|
||||||
await this._tokenCallbackPromise;
|
await this._tokenCallbackPromise;
|
||||||
return;
|
return;
|
||||||
|
} catch (e) {
|
||||||
|
// _tokenCallbackPromise is in a rejected state
|
||||||
|
// Clear the _tokenCallbackPromise and go on refreshing access token
|
||||||
|
this._tokenCallbackPromise = undefined;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
const payload: GetExternalAuthPayload = {
|
const payload: GetExternalAuthPayload = {
|
||||||
callback: CALLBACK_SET_TOKEN,
|
callback: CALLBACK_SET_TOKEN,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user