mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-30 12:46:35 +00:00
Fix external auth reconnection loop if connection lost after refresh token expiration (#8279)
This commit is contained in:
parent
b8e9a4ce9f
commit
bffcccc1fe
@ -68,8 +68,14 @@ export class ExternalAuth extends Auth {
|
||||
|
||||
public async refreshAccessToken(force?: boolean) {
|
||||
if (this._tokenCallbackPromise && !force) {
|
||||
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