mirror of
https://github.com/home-assistant/frontend.git
synced 2025-04-24 13:27:22 +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) {
|
||||
if (this._tokenCallbackPromise && !force) {
|
||||
await this._tokenCallbackPromise;
|
||||
return;
|
||||
try {
|
||||
await this._tokenCallbackPromise;
|
||||
return;
|
||||
} catch (e) {
|
||||
// _tokenCallbackPromise is in a rejected state
|
||||
// Clear the _tokenCallbackPromise and go on refreshing access token
|
||||
this._tokenCallbackPromise = undefined;
|
||||
}
|
||||
}
|
||||
const payload: GetExternalAuthPayload = {
|
||||
callback: CALLBACK_SET_TOKEN,
|
||||
|
Loading…
x
Reference in New Issue
Block a user