@tstdl/base 0.93.189 → 0.93.190
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -558,10 +558,6 @@ let AuthenticationClientService = class AuthenticationClientService {
|
|
|
558
558
|
// If lock is held by another instance/tab, wait briefly for it to finish (passive sync)
|
|
559
559
|
if (!lockResult.success) {
|
|
560
560
|
await waitForNextAction(5000);
|
|
561
|
-
// If another tab successfully refreshed, the expiration will have changed
|
|
562
|
-
if (this.token()?.exp !== token.exp) {
|
|
563
|
-
this.forceRefreshRequested.set(false);
|
|
564
|
-
}
|
|
565
561
|
}
|
|
566
562
|
// Protection against tight loops (e.g. if server clock is ahead and sync failed)
|
|
567
563
|
const newToken = this.token();
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { firstValueFrom, race, timeout as rxjsTimeout } from 'rxjs';
|
|
2
2
|
import { HttpError } from '../../http/index.js';
|
|
3
3
|
import { supportsCookies } from '../../supports.js';
|
|
4
|
-
import { timeout } from '../../utils/timing.js';
|
|
5
4
|
import { isDefined } from '../../utils/type-guards.js';
|
|
6
5
|
import { cacheValueOrAsyncProvider } from '../../utils/value-or-provider.js';
|
|
7
6
|
import { dontWaitForValidToken } from '../authentication.api.js';
|
|
@@ -19,15 +18,13 @@ export function waitForAuthenticationMiddleware(authenticationServiceOrProvider)
|
|
|
19
18
|
while (!authenticationService.hasValidToken && authenticationService.isLoggedIn()) {
|
|
20
19
|
const race$ = race([
|
|
21
20
|
authenticationService.validToken$,
|
|
21
|
+
authenticationService.loggedOut$,
|
|
22
22
|
request.cancellationSignal,
|
|
23
23
|
]);
|
|
24
24
|
await firstValueFrom(race$.pipe(rxjsTimeout(30000))).catch(() => undefined);
|
|
25
|
-
if (request.cancellationSignal.isSet) {
|
|
25
|
+
if (request.cancellationSignal.isSet || !authenticationService.isLoggedIn()) {
|
|
26
26
|
break;
|
|
27
27
|
}
|
|
28
|
-
if (!authenticationService.hasValidToken && authenticationService.isLoggedIn()) {
|
|
29
|
-
await timeout(100);
|
|
30
|
-
}
|
|
31
28
|
}
|
|
32
29
|
}
|
|
33
30
|
await next();
|
package/package.json
CHANGED
package/signals/notifier.js
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { computed, signal } from './api.js';
|
|
2
2
|
export function createNotifier() {
|
|
3
3
|
const sourceSignal = signal(0);
|
|
4
|
-
|
|
4
|
+
return {
|
|
5
5
|
listen: sourceSignal.asReadonly(),
|
|
6
|
-
notify
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
notify() {
|
|
7
|
+
sourceSignal.update((v) => v + 1);
|
|
8
|
+
},
|
|
9
|
+
computed(computation, options) {
|
|
10
|
+
return computed(() => {
|
|
11
|
+
sourceSignal();
|
|
12
|
+
return computation();
|
|
13
|
+
}, options);
|
|
14
|
+
},
|
|
11
15
|
};
|
|
12
|
-
return notifier;
|
|
13
16
|
}
|