@owlmeans/web-client 0.1.18-rc.60 → 0.1.18-rc.61
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.
- package/README.md +3 -3
- package/agent-meta/manifest.json +2 -2
- package/agent-meta/skills/web-client/SKILL.md +6 -6
- package/build/components/dispatcher/component.d.ts.map +1 -1
- package/build/components/dispatcher/component.js +2 -2
- package/build/components/dispatcher/component.js.map +1 -1
- package/build/entrypoints.d.ts +7 -1
- package/build/entrypoints.d.ts.map +1 -1
- package/build/exports.d.ts +3 -3
- package/build/exports.d.ts.map +1 -1
- package/build/exports.js +2 -2
- package/build/exports.js.map +1 -1
- package/build/i18n.js +9 -9
- package/build/i18n.js.map +1 -1
- package/build/login/redirect.js +2 -2
- package/build/login/redirect.js.map +1 -1
- package/build/login/surrogate.d.ts.map +1 -1
- package/build/login/surrogate.js +7 -7
- package/build/login/surrogate.js.map +1 -1
- package/package.json +18 -18
- package/src/components/dispatcher/component.tsx +2 -4
- package/src/exports.ts +3 -4
- package/src/i18n.ts +9 -9
- package/src/login/redirect.ts +2 -2
- package/src/login/surrogate.ts +7 -11
- package/tests/surrogate.spec.ts +6 -3
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@ is the legacy MUI layer — start nothing new there. React Native apps use the `
|
|
|
11
11
|
## Installation
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
bun add @owlmeans/web-client@^0.1.18-rc.
|
|
14
|
+
bun add @owlmeans/web-client@^0.1.18-rc.61
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
## Concepts
|
|
@@ -243,7 +243,7 @@ export const LogoDrop: FC<{ onFile: (file: File) => void }> = ({ onFile }) =>
|
|
|
243
243
|
| `config` | `@owlmeans/client-context` |
|
|
244
244
|
| `service` | `@owlmeans/config` |
|
|
245
245
|
| `AppType`, `HOME`, `ROOT`, `BASE`, `GUEST` | `@owlmeans/context` |
|
|
246
|
-
| `bind`, `bindAll`, `bindScreen`, `
|
|
246
|
+
| `bind`, `bindAll`, `bindScreen`, `clientRequestHelper`, `provideRequest` (deprecated, use `clientRequestHelper.provideRequest`), `stab`; types `ClientEntrypoint`, `Module` | `@owlmeans/client-entrypoint` |
|
|
247
247
|
| `route`, `frontend` | `@owlmeans/route` |
|
|
248
248
|
| type `Route` (`ClientRoute`) | `@owlmeans/client-route` |
|
|
249
249
|
|
|
@@ -289,7 +289,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
|
|
|
289
289
|
your project's skill store (`.agents/skills/`):
|
|
290
290
|
|
|
291
291
|
```sh
|
|
292
|
-
npx @owlmeans/agent-skills@^0.1.18-rc.
|
|
292
|
+
npx @owlmeans/agent-skills@^0.1.18-rc.49
|
|
293
293
|
```
|
|
294
294
|
|
|
295
295
|
The embedded files are version-matched to this package release. Do not edit them
|
package/agent-meta/manifest.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 2,
|
|
3
3
|
"package": "@owlmeans/web-client",
|
|
4
|
-
"version": "0.1.18-rc.
|
|
5
|
-
"generatedAt": "2026-10-
|
|
4
|
+
"version": "0.1.18-rc.61",
|
|
5
|
+
"generatedAt": "2026-10-05T21:03:06.394Z",
|
|
6
6
|
"canonicalRepo": "https://github.com/owlmeans/common",
|
|
7
7
|
"entries": [
|
|
8
8
|
{
|
|
@@ -6,7 +6,7 @@ description: Bind OwlMeans shared entrypoint protocols in a browser application.
|
|
|
6
6
|
|
|
7
7
|
# Browser protocol entrypoints
|
|
8
8
|
|
|
9
|
-
**Install:** `bun add @owlmeans/web-client@^0.1.18-rc.
|
|
9
|
+
**Install:** `bun add @owlmeans/web-client@^0.1.18-rc.61`
|
|
10
10
|
|
|
11
11
|
Shared protocol declarations are immutable. Bind a complete protocol tree for callable API routes,
|
|
12
12
|
then bind frontend declarations to screens.
|
|
@@ -34,8 +34,8 @@ const project = await context.entrypoint(projectProtocols.get).call({
|
|
|
34
34
|
## Lazily-loaded screens
|
|
35
35
|
|
|
36
36
|
`lazyHandler` and `lazyComponent` (from `@owlmeans/client`) are re-exported here and by
|
|
37
|
-
`@owlmeans/web-panel`, next to `handler`; so are, here only, the chunk-failure tools
|
|
38
|
-
`retryImport`, `isChunkLoadError`, `reloadOnce` and `recoverFromChunkError` (types
|
|
37
|
+
`@owlmeans/web-panel`, next to `handler`; so are, here only, the chunk-failure tools of
|
|
38
|
+
`lazyRetryHelper` — `retryImport`, `isChunkLoadError`, `reloadOnce` and `recoverFromChunkError` (types
|
|
39
39
|
`LazyErrorRenderer`, `RetryImportOptions`). A `lazyHandler(...)` result binds exactly like
|
|
40
40
|
`handler(Component)`; declare it at module scope, where the bindings live — never inside a render.
|
|
41
41
|
|
|
@@ -59,16 +59,16 @@ reload starts. Rules and options: the `client` skill, Code-splitting and Chunk f
|
|
|
59
59
|
|
|
60
60
|
## Rendering after an async boot
|
|
61
61
|
|
|
62
|
-
If your app awaits something (e.g. `prepareI18n`) before calling `render()`, this is handled
|
|
62
|
+
If your app awaits something (e.g. `i18nInstanceHelper.prepareI18n`) before calling `render()`, this is handled
|
|
63
63
|
correctly — the render helper checks `document.readyState` rather than unconditionally waiting for
|
|
64
64
|
an event that may already have fired. It waits for `DOMContentLoaded` only while the document is
|
|
65
65
|
still `loading` and mounts at once otherwise; `renderApp` and `@owlmeans/web-panel`'s `render` both
|
|
66
66
|
go through it.
|
|
67
67
|
|
|
68
68
|
```ts
|
|
69
|
-
import {
|
|
69
|
+
import { i18nInstanceHelper } from '@owlmeans/client-i18n'
|
|
70
70
|
|
|
71
|
-
await prepareI18n(context.cfg)
|
|
71
|
+
await i18nInstanceHelper.prepareI18n(context.cfg)
|
|
72
72
|
renderApp(context) // or @owlmeans/web-panel's render(context)
|
|
73
73
|
```
|
|
74
74
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/components/dispatcher/component.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/components/dispatcher/component.tsx"],"names":[],"mappings":"AASA,eAAO,MAAM,UAAU,6FA+FrB,CAAA"}
|
|
@@ -3,7 +3,7 @@ import { DispatcherHOC } from '@owlmeans/client-auth';
|
|
|
3
3
|
import { useEffect, useState } from 'react';
|
|
4
4
|
import { useI18nLib } from '@owlmeans/client-i18n';
|
|
5
5
|
import { AUTH_QUERY } from '@owlmeans/auth';
|
|
6
|
-
import { FallbackLoginScreen, LoginIntent, LoginOutcome, ResumeAction,
|
|
6
|
+
import { FallbackLoginScreen, LoginIntent, LoginOutcome, ResumeAction, loginResumeHelper } from '@owlmeans/client-auth/login';
|
|
7
7
|
import { LoginSurrogateView } from '../../login/view.js';
|
|
8
8
|
import { SurrogateStage } from '../../login/consts.js';
|
|
9
9
|
import { useContext } from '../../context.js';
|
|
@@ -42,7 +42,7 @@ export const Dispatcher = DispatcherHOC(({ provideToken, navigate }) => {
|
|
|
42
42
|
// A session already exists in THIS document. Whether it is useful here, or belongs to the
|
|
43
43
|
// window that opened this one, is the plugin's call — the dispatcher reads no environment.
|
|
44
44
|
const settled = await context.login().resume(authzToken);
|
|
45
|
-
switch (resumeAction(settled)) {
|
|
45
|
+
switch (loginResumeHelper.resumeAction(settled)) {
|
|
46
46
|
case ResumeAction.Stop:
|
|
47
47
|
return;
|
|
48
48
|
case ResumeAction.Render:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../src/components/dispatcher/component.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AACrD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,
|
|
1
|
+
{"version":3,"file":"component.js","source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EAAE,QAAQ,EAAE,8BAA8B;YACnD,UAAU,EAAE,MAAM,EAAE,6BAA6B;YACjD,aAAa,EAAE,MAAM,EAAE,6BAA6B;SACrD,YAAG,CAAC,CAAC,SAAS,CAAC,GAAO,CAAC,CAAC,CAAC,SAAS,CAAA;AACrC,CAAC,CAAC,CAAA"}
|
package/build/entrypoints.d.ts
CHANGED
|
@@ -6,5 +6,11 @@
|
|
|
6
6
|
* means `web-panel`, `mui-panel` and every generated target gain a working login window with no
|
|
7
7
|
* edit of their own, which is the only way an application that is already deployed can get it.
|
|
8
8
|
*/
|
|
9
|
-
export declare const entrypoints: import("@owlmeans/client-entrypoint").ClientProtocolEntrypoint<
|
|
9
|
+
export declare const entrypoints: (import("@owlmeans/client-entrypoint").ClientProtocolEntrypoint<import("@owlmeans/entrypoint").EntrypointProtocol<{
|
|
10
|
+
query: import("@owlmeans/auth").AuthToken;
|
|
11
|
+
}, unknown>> | import("@owlmeans/client-entrypoint").ClientProtocolEntrypoint<import("@owlmeans/entrypoint").EntrypointProtocol<{
|
|
12
|
+
query: import("@owlmeans/auth-common").SurrogateQuery;
|
|
13
|
+
}, unknown>> | import("@owlmeans/client-entrypoint").ClientProtocolEntrypoint<import("@owlmeans/entrypoint").EntrypointProtocol<{
|
|
14
|
+
body: import("@owlmeans/auth").AuthToken;
|
|
15
|
+
}, import("@owlmeans/auth").AuthToken>>)[];
|
|
10
16
|
//# sourceMappingURL=entrypoints.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entrypoints.d.ts","sourceRoot":"","sources":["../src/entrypoints.ts"],"names":[],"mappings":"AAOA;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"entrypoints.d.ts","sourceRoot":"","sources":["../src/entrypoints.ts"],"names":[],"mappings":"AAOA;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW;;;;;;0CAIvB,CAAA"}
|
package/build/exports.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { handler, lazyHandler, lazyComponent,
|
|
2
|
-
export type { LazyComponent, LazyComponentOptions, LazyErrorRenderer, LazyHandler, RetryImportOptions } from '@owlmeans/client';
|
|
1
|
+
export { handler, lazyHandler, lazyComponent, lazyRetryHelper, recoverFromChunkError, } from '@owlmeans/client';
|
|
2
|
+
export type { LazyComponent, LazyComponentOptions, LazyErrorRenderer, LazyHandler, LazyRetryHelper, RetryImportOptions } from '@owlmeans/client';
|
|
3
3
|
export { config } from '@owlmeans/client-context';
|
|
4
4
|
export { service } from '@owlmeans/config';
|
|
5
5
|
export { AppType, HOME, ROOT, BASE, GUEST } from '@owlmeans/context';
|
|
6
|
-
export { bind, bindAll, bindScreen, provideRequest, stab } from '@owlmeans/client-entrypoint';
|
|
6
|
+
export { bind, bindAll, bindScreen, clientRequestHelper, provideRequest, stab } from '@owlmeans/client-entrypoint';
|
|
7
7
|
export { route, frontend } from '@owlmeans/route';
|
|
8
8
|
export type { ClientEntrypoint } from '@owlmeans/client-entrypoint';
|
|
9
9
|
export type { ClientEntrypoint as Module } from '@owlmeans/client-entrypoint';
|
package/build/exports.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../src/exports.ts"],"names":[],"mappings":"AACA,OAAO,EACL,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../src/exports.ts"],"names":[],"mappings":"AACA,OAAO,EACL,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,eAAe,EAAE,qBAAqB,GAC5E,MAAM,kBAAkB,CAAA;AACzB,YAAY,EACV,aAAa,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,WAAW,EAAE,eAAe,EAAE,kBAAkB,EACzG,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAC1C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACpE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAA;AAClH,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AACjD,YAAY,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AACnE,YAAY,EAAE,gBAAgB,IAAI,MAAM,EAAE,MAAM,6BAA6B,CAAA;AAC7E,YAAY,EAAE,WAAW,IAAI,KAAK,EAAE,MAAM,wBAAwB,CAAA"}
|
package/build/exports.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { handler, lazyHandler, lazyComponent,
|
|
1
|
+
export { handler, lazyHandler, lazyComponent, lazyRetryHelper, recoverFromChunkError, } from '@owlmeans/client';
|
|
2
2
|
export { config } from '@owlmeans/client-context';
|
|
3
3
|
export { service } from '@owlmeans/config';
|
|
4
4
|
export { AppType, HOME, ROOT, BASE, GUEST } from '@owlmeans/context';
|
|
5
|
-
export { bind, bindAll, bindScreen, provideRequest, stab } from '@owlmeans/client-entrypoint';
|
|
5
|
+
export { bind, bindAll, bindScreen, clientRequestHelper, provideRequest, stab } from '@owlmeans/client-entrypoint';
|
|
6
6
|
export { route, frontend } from '@owlmeans/route';
|
|
7
7
|
//# sourceMappingURL=exports.js.map
|
package/build/exports.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exports.js","sourceRoot":"","sources":["../src/exports.ts"],"names":[],"mappings":"AACA,OAAO,EACL,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"exports.js","sourceRoot":"","sources":["../src/exports.ts"],"names":[],"mappings":"AACA,OAAO,EACL,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,eAAe,EAAE,qBAAqB,GAC5E,MAAM,kBAAkB,CAAA;AAIzB,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAC1C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACpE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAA;AAClH,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA"}
|
package/build/i18n.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i18nHelper } from '@owlmeans/i18n';
|
|
2
2
|
import authEn from './i18n/auth-en.json' with { type: 'json' };
|
|
3
3
|
import authPl from './i18n/auth-pl.json' with { type: 'json' };
|
|
4
4
|
import authRu from './i18n/auth-ru.json' with { type: 'json' };
|
|
@@ -7,12 +7,12 @@ import authUk from './i18n/auth-uk.json' with { type: 'json' };
|
|
|
7
7
|
import authEs from './i18n/auth-es.json' with { type: 'json' };
|
|
8
8
|
import authDe from './i18n/auth-de.json' with { type: 'json' };
|
|
9
9
|
import authFr from './i18n/auth-fr.json' with { type: 'json' };
|
|
10
|
-
addI18nLib('en', 'auth', authEn);
|
|
11
|
-
addI18nLib('pl', 'auth', authPl);
|
|
12
|
-
addI18nLib('ru', 'auth', authRu);
|
|
13
|
-
addI18nLib('be', 'auth', authBe);
|
|
14
|
-
addI18nLib('uk', 'auth', authUk);
|
|
15
|
-
addI18nLib('es', 'auth', authEs);
|
|
16
|
-
addI18nLib('de', 'auth', authDe);
|
|
17
|
-
addI18nLib('fr', 'auth', authFr);
|
|
10
|
+
i18nHelper.addI18nLib('en', 'auth', authEn);
|
|
11
|
+
i18nHelper.addI18nLib('pl', 'auth', authPl);
|
|
12
|
+
i18nHelper.addI18nLib('ru', 'auth', authRu);
|
|
13
|
+
i18nHelper.addI18nLib('be', 'auth', authBe);
|
|
14
|
+
i18nHelper.addI18nLib('uk', 'auth', authUk);
|
|
15
|
+
i18nHelper.addI18nLib('es', 'auth', authEs);
|
|
16
|
+
i18nHelper.addI18nLib('de', 'auth', authDe);
|
|
17
|
+
i18nHelper.addI18nLib('fr', 'auth', authFr);
|
|
18
18
|
//# sourceMappingURL=i18n.js.map
|
package/build/i18n.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../src/i18n.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAE3C,OAAO,MAAM,MAAM,qBAAqB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AAC9D,OAAO,MAAM,MAAM,qBAAqB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AAC9D,OAAO,MAAM,MAAM,qBAAqB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AAC9D,OAAO,MAAM,MAAM,qBAAqB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AAC9D,OAAO,MAAM,MAAM,qBAAqB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AAC9D,OAAO,MAAM,MAAM,qBAAqB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AAC9D,OAAO,MAAM,MAAM,qBAAqB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AAC9D,OAAO,MAAM,MAAM,qBAAqB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AAE9D,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../src/i18n.ts"],"names":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AE,MAAM,CAAC,CAAA"}
|
package/build/login/redirect.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LoginOutcome, loginTokenOf } from '@owlmeans/client-auth/login';
|
|
2
2
|
import { REDIRECT_LOGIN } from './consts.js';
|
|
3
3
|
/**
|
|
4
4
|
* The ordinary login flow: this document leaves for the identity provider and comes back.
|
|
@@ -30,7 +30,7 @@ export const makeRedirectLoginPlugin = () => ({
|
|
|
30
30
|
// `resume` is deliberately NOT implemented. The host defaults to `Passed`, which is "keep the
|
|
31
31
|
// session you already have and carry on" — byte for byte what an ordinary tab has always done.
|
|
32
32
|
// Implementing it here would be the one way to regress every unframed application.
|
|
33
|
-
logout: (ctx, request) =>
|
|
33
|
+
logout: (ctx, request) => loginTokenOf(ctx).revokeToken().then(async () => {
|
|
34
34
|
if (request.navigate != null) {
|
|
35
35
|
await request.navigate();
|
|
36
36
|
return LoginOutcome.Handled;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redirect.js","sourceRoot":"","sources":["../../src/login/redirect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"redirect.js","sourceRoot":"","sources":["../../src/login/redirect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAExE,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAE5C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAgB,EAAE,CAAC,CAAC;IACzD,KAAK,EAAE,cAAc;IACrB,QAAQ,EAAE,CAAC;IACX,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,GAAG,EAAE,CAAC,IAAI;IAEjB,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE;QAC7B,yFAAyF;QACzF,8FAA8F;QAC9F,IAAI,OAAO,CAAC,QAAQ,IAAI,IAAI,EAAE,CAAC;YAC7B,MAAM,OAAO,CAAC,QAAQ,EAAE,CAAA;YAExB,OAAO,YAAY,CAAC,OAAO,CAAA;QAC7B,CAAC;QACD,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,OAAO,CAAC,GAAG,CAAA;QAElC,OAAO,YAAY,CAAC,UAAU,CAAA;IAChC,CAAC;IAED,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE;QAC7B,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,GAAG,CAAA;QAE1B,OAAO,YAAY,CAAC,UAAU,CAAA;IAChC,CAAC;IAED,oFAAoF;IACpF,QAAQ,EAAE,KAAK,IAAI,EAAE,CAAC,YAAY,CAAC,MAAM;IAEzC,8FAA8F;IAC9F,+FAA+F;IAC/F,mFAAmF;IAEnF,MAAM,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,CAAC,YAAY,CAAC,GAAmB,CAAC,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE;QACxF,IAAI,OAAO,CAAC,QAAQ,IAAI,IAAI,EAAE,CAAC;YAC7B,MAAM,OAAO,CAAC,QAAQ,EAAE,CAAA;YAExB,OAAO,YAAY,CAAC,OAAO,CAAA;QAC7B,CAAC;QACD,uFAAuF;QACvF,sFAAsF;QACtF,uFAAuF;QACvF,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAA;QAExB,OAAO,YAAY,CAAC,OAAO,CAAA;IAC7B,CAAC,CAAC;IAEF,kFAAkF;IAClF,cAAc,EAAE,KAAK,IAAI,EAAE,CAAC,YAAY,CAAC,MAAM;CAChD,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"surrogate.d.ts","sourceRoot":"","sources":["../../src/login/surrogate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"surrogate.d.ts","sourceRoot":"","sources":["../../src/login/surrogate.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAA0B,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAItF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,qBAAqB,UAAW,MAAM,UAAU,MAAM,KAAG,MAUrE,CAAA;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,wBAAwB,QAAO,WA4J3C,CAAA"}
|
package/build/login/surrogate.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { surrogatePath, LoginIntent, LoginOutcome, LOGIN_LOGOUT_MESSAGE, LOGIN_SURROGATE_HEIGHT, LOGIN_SURROGATE_NAME, LOGIN_SURROGATE_WIDTH, LOGIN_TOKEN_MESSAGE, loginEnvHelper, loginTokenOf } from '@owlmeans/client-auth/login';
|
|
2
2
|
import { SURROGATE_LOGIN, SURROGATE_LOGIN_PRIORITY } from './consts.js';
|
|
3
3
|
import { awaitSurrogate } from './pump.js';
|
|
4
4
|
/**
|
|
@@ -60,7 +60,7 @@ export const makeSurrogateLoginPlugin = () => {
|
|
|
60
60
|
// provider severs `window.opener` permanently, so this is not a timing problem to retry.
|
|
61
61
|
return LoginOutcome.Orphaned;
|
|
62
62
|
}
|
|
63
|
-
clearSurrogate();
|
|
63
|
+
loginEnvHelper.clearSurrogate();
|
|
64
64
|
// Both windows are the same origin (the surrogate is this application's own login route), so
|
|
65
65
|
// the origin is pinned rather than passed as `*` — the message carries a bearer token.
|
|
66
66
|
window.opener.postMessage({ type: LOGIN_TOKEN_MESSAGE, token }, window.location.origin);
|
|
@@ -72,7 +72,7 @@ export const makeSurrogateLoginPlugin = () => {
|
|
|
72
72
|
priority: SURROGATE_LOGIN_PRIORITY,
|
|
73
73
|
mode: 'surrogate',
|
|
74
74
|
match: env => env.hasWindow && (env.embedded || env.surrogate),
|
|
75
|
-
enter: () => { markSurrogate(); },
|
|
75
|
+
enter: () => { loginEnvHelper.markSurrogate(); },
|
|
76
76
|
begin: (ctx, request, env) => {
|
|
77
77
|
// Already one window up — nothing to open, just run the flow.
|
|
78
78
|
if (env.surrogate) {
|
|
@@ -99,7 +99,7 @@ export const makeSurrogateLoginPlugin = () => {
|
|
|
99
99
|
if (data.token == null || data.token === '') {
|
|
100
100
|
return LoginOutcome.Failed;
|
|
101
101
|
}
|
|
102
|
-
await adoptToken(
|
|
102
|
+
await loginTokenOf(ctx).adoptToken(data.token);
|
|
103
103
|
// Adopting the token is not the end of the flow — running the caller's continuation is,
|
|
104
104
|
// exactly as the redirect plugin does before it reports `Handled`. Without it the token
|
|
105
105
|
// lands in the auth service and nothing else happens: the framed app keeps rendering its
|
|
@@ -128,7 +128,7 @@ export const makeSurrogateLoginPlugin = () => {
|
|
|
128
128
|
logout: (ctx, request, env) => {
|
|
129
129
|
// Already one window up — end the session here and tell the opener.
|
|
130
130
|
if (env.surrogate) {
|
|
131
|
-
return
|
|
131
|
+
return loginTokenOf(ctx).revokeToken()
|
|
132
132
|
.then(async () => await plugin.logoutComplete(ctx, env));
|
|
133
133
|
}
|
|
134
134
|
const path = surrogatePath(ctx, { intent: LoginIntent.Logout });
|
|
@@ -139,7 +139,7 @@ export const makeSurrogateLoginPlugin = () => {
|
|
|
139
139
|
// The local session goes next, and UNCONDITIONALLY. A blocked window, a severed opener or a
|
|
140
140
|
// user who closes the popup must never leave THIS document signed in: a logout that only
|
|
141
141
|
// half happened is bad, and one that did not happen at all is worse.
|
|
142
|
-
const local =
|
|
142
|
+
const local = loginTokenOf(ctx).revokeToken();
|
|
143
143
|
if (surrogate == null) {
|
|
144
144
|
// `path == null` is an app whose entrypoint list predates the surrogate route — nothing a
|
|
145
145
|
// retry would do differently. A `window.open` the browser refused is the one case worth
|
|
@@ -162,7 +162,7 @@ export const makeSurrogateLoginPlugin = () => {
|
|
|
162
162
|
if (!env.hasOpener) {
|
|
163
163
|
return LoginOutcome.Orphaned;
|
|
164
164
|
}
|
|
165
|
-
clearSurrogate();
|
|
165
|
+
loginEnvHelper.clearSurrogate();
|
|
166
166
|
window.opener.postMessage({ type: LOGIN_LOGOUT_MESSAGE, ok: true }, window.location.origin);
|
|
167
167
|
window.close();
|
|
168
168
|
return LoginOutcome.Handled;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"surrogate.js","sourceRoot":"","sources":["../../src/login/surrogate.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"surrogate.js","sourceRoot":"","sources":["../../src/login/surrogate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,YAAY,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAEpO,OAAO,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAE1C;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,KAAa,EAAE,MAAc,EAAU,EAAE;IAC7E,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,IAAI,MAAM,CAAC,OAAO,IAAI,CAAC,CAAA;IAC3D,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,OAAO,IAAI,CAAC,CAAA;IACzD,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAA;IAC3D,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,CAAA;IAE9D,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,UAAU,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;IAC3E,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS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AAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;YAC3F,MAAM,CAAC,KAAK,EAAE,CAAA;YAEd,OAAO,YAAY,CAAC,OAAO,CAAA;QAC7B,CAAC;KACF,CAAA;IAED,OAAO,MAAM,CAAA;AACf,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owlmeans/web-client",
|
|
3
|
-
"version": "0.1.18-rc.
|
|
3
|
+
"version": "0.1.18-rc.61",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -21,23 +21,23 @@
|
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@owlmeans/auth": "^0.1.18-rc.
|
|
25
|
-
"@owlmeans/auth-common": "^0.1.18-rc.
|
|
26
|
-
"@owlmeans/client": "^0.1.18-rc.
|
|
27
|
-
"@owlmeans/client-auth": "^0.1.18-rc.
|
|
28
|
-
"@owlmeans/client-context": "^0.1.18-rc.
|
|
29
|
-
"@owlmeans/client-i18n": "^0.1.18-rc.
|
|
30
|
-
"@owlmeans/client-entrypoint": "^0.1.18-rc.
|
|
31
|
-
"@owlmeans/client-resource": "^0.1.18-rc.
|
|
32
|
-
"@owlmeans/client-route": "^0.1.18-rc.
|
|
33
|
-
"@owlmeans/config": "^0.1.18-rc.
|
|
34
|
-
"@owlmeans/context": "^0.1.18-rc.
|
|
35
|
-
"@owlmeans/error": "^0.1.18-rc.
|
|
36
|
-
"@owlmeans/i18n": "^0.1.18-rc.
|
|
37
|
-
"@owlmeans/log": "^0.1.18-rc.
|
|
38
|
-
"@owlmeans/route": "^0.1.18-rc.
|
|
39
|
-
"@owlmeans/web-db": "^0.1.18-rc.
|
|
40
|
-
"@owlmeans/web-router": "^0.1.18-rc.
|
|
24
|
+
"@owlmeans/auth": "^0.1.18-rc.40",
|
|
25
|
+
"@owlmeans/auth-common": "^0.1.18-rc.47",
|
|
26
|
+
"@owlmeans/client": "^0.1.18-rc.51",
|
|
27
|
+
"@owlmeans/client-auth": "^0.1.18-rc.58",
|
|
28
|
+
"@owlmeans/client-context": "^0.1.18-rc.48",
|
|
29
|
+
"@owlmeans/client-i18n": "^0.1.18-rc.50",
|
|
30
|
+
"@owlmeans/client-entrypoint": "^0.1.18-rc.47",
|
|
31
|
+
"@owlmeans/client-resource": "^0.1.18-rc.47",
|
|
32
|
+
"@owlmeans/client-route": "^0.1.18-rc.48",
|
|
33
|
+
"@owlmeans/config": "^0.1.18-rc.44",
|
|
34
|
+
"@owlmeans/context": "^0.1.18-rc.34",
|
|
35
|
+
"@owlmeans/error": "^0.1.18-rc.38",
|
|
36
|
+
"@owlmeans/i18n": "^0.1.18-rc.39",
|
|
37
|
+
"@owlmeans/log": "^0.1.18-rc.2",
|
|
38
|
+
"@owlmeans/route": "^0.1.18-rc.35",
|
|
39
|
+
"@owlmeans/web-db": "^0.1.18-rc.48",
|
|
40
|
+
"@owlmeans/web-router": "^0.1.18-rc.49",
|
|
41
41
|
"react-dropzone": "^20.1.2"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
@@ -2,9 +2,7 @@ import { DispatcherHOC } from '@owlmeans/client-auth'
|
|
|
2
2
|
import { useEffect, useState } from 'react'
|
|
3
3
|
import { useI18nLib } from '@owlmeans/client-i18n'
|
|
4
4
|
import { AUTH_QUERY } from '@owlmeans/auth'
|
|
5
|
-
import {
|
|
6
|
-
FallbackLoginScreen, LoginIntent, LoginOutcome, ResumeAction, resumeAction,
|
|
7
|
-
} from '@owlmeans/client-auth/login'
|
|
5
|
+
import { FallbackLoginScreen, LoginIntent, LoginOutcome, ResumeAction, loginResumeHelper } from '@owlmeans/client-auth/login'
|
|
8
6
|
import { LoginSurrogateView } from '../../login/view.js'
|
|
9
7
|
import { SurrogateStage } from '../../login/consts.js'
|
|
10
8
|
import { useContext } from '../../context.js'
|
|
@@ -52,7 +50,7 @@ export const Dispatcher = DispatcherHOC(({ provideToken, navigate }) => {
|
|
|
52
50
|
// A session already exists in THIS document. Whether it is useful here, or belongs to the
|
|
53
51
|
// window that opened this one, is the plugin's call — the dispatcher reads no environment.
|
|
54
52
|
const settled = await context.login().resume(authzToken)
|
|
55
|
-
switch (resumeAction(settled)) {
|
|
53
|
+
switch (loginResumeHelper.resumeAction(settled)) {
|
|
56
54
|
case ResumeAction.Stop:
|
|
57
55
|
return
|
|
58
56
|
case ResumeAction.Render:
|
package/src/exports.ts
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
|
|
2
2
|
export {
|
|
3
|
-
handler, lazyHandler, lazyComponent,
|
|
4
|
-
chunkUrlOf, cacheBustedUrl,
|
|
3
|
+
handler, lazyHandler, lazyComponent, lazyRetryHelper, recoverFromChunkError,
|
|
5
4
|
} from '@owlmeans/client'
|
|
6
5
|
export type {
|
|
7
|
-
LazyComponent, LazyComponentOptions, LazyErrorRenderer, LazyHandler, RetryImportOptions
|
|
6
|
+
LazyComponent, LazyComponentOptions, LazyErrorRenderer, LazyHandler, LazyRetryHelper, RetryImportOptions
|
|
8
7
|
} from '@owlmeans/client'
|
|
9
8
|
export { config } from '@owlmeans/client-context'
|
|
10
9
|
export { service } from '@owlmeans/config'
|
|
11
10
|
export { AppType, HOME, ROOT, BASE, GUEST } from '@owlmeans/context'
|
|
12
|
-
export { bind, bindAll, bindScreen, provideRequest, stab } from '@owlmeans/client-entrypoint'
|
|
11
|
+
export { bind, bindAll, bindScreen, clientRequestHelper, provideRequest, stab } from '@owlmeans/client-entrypoint'
|
|
13
12
|
export { route, frontend } from '@owlmeans/route'
|
|
14
13
|
export type { ClientEntrypoint } from '@owlmeans/client-entrypoint'
|
|
15
14
|
export type { ClientEntrypoint as Module } from '@owlmeans/client-entrypoint'
|
package/src/i18n.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i18nHelper } from '@owlmeans/i18n'
|
|
2
2
|
|
|
3
3
|
import authEn from './i18n/auth-en.json' with { type: 'json' }
|
|
4
4
|
import authPl from './i18n/auth-pl.json' with { type: 'json' }
|
|
@@ -9,11 +9,11 @@ import authEs from './i18n/auth-es.json' with { type: 'json' }
|
|
|
9
9
|
import authDe from './i18n/auth-de.json' with { type: 'json' }
|
|
10
10
|
import authFr from './i18n/auth-fr.json' with { type: 'json' }
|
|
11
11
|
|
|
12
|
-
addI18nLib('en', 'auth', authEn)
|
|
13
|
-
addI18nLib('pl', 'auth', authPl)
|
|
14
|
-
addI18nLib('ru', 'auth', authRu)
|
|
15
|
-
addI18nLib('be', 'auth', authBe)
|
|
16
|
-
addI18nLib('uk', 'auth', authUk)
|
|
17
|
-
addI18nLib('es', 'auth', authEs)
|
|
18
|
-
addI18nLib('de', 'auth', authDe)
|
|
19
|
-
addI18nLib('fr', 'auth', authFr)
|
|
12
|
+
i18nHelper.addI18nLib('en', 'auth', authEn)
|
|
13
|
+
i18nHelper.addI18nLib('pl', 'auth', authPl)
|
|
14
|
+
i18nHelper.addI18nLib('ru', 'auth', authRu)
|
|
15
|
+
i18nHelper.addI18nLib('be', 'auth', authBe)
|
|
16
|
+
i18nHelper.addI18nLib('uk', 'auth', authUk)
|
|
17
|
+
i18nHelper.addI18nLib('es', 'auth', authEs)
|
|
18
|
+
i18nHelper.addI18nLib('de', 'auth', authDe)
|
|
19
|
+
i18nHelper.addI18nLib('fr', 'auth', authFr)
|
package/src/login/redirect.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LoginOutcome, loginTokenOf } from '@owlmeans/client-auth/login'
|
|
2
2
|
import type { LoginContext, LoginPlugin } from '@owlmeans/client-auth/login'
|
|
3
3
|
import { REDIRECT_LOGIN } from './consts.js'
|
|
4
4
|
|
|
@@ -40,7 +40,7 @@ export const makeRedirectLoginPlugin = (): LoginPlugin => ({
|
|
|
40
40
|
// session you already have and carry on" — byte for byte what an ordinary tab has always done.
|
|
41
41
|
// Implementing it here would be the one way to regress every unframed application.
|
|
42
42
|
|
|
43
|
-
logout: (ctx, request) =>
|
|
43
|
+
logout: (ctx, request) => loginTokenOf(ctx as LoginContext).revokeToken().then(async () => {
|
|
44
44
|
if (request.navigate != null) {
|
|
45
45
|
await request.navigate()
|
|
46
46
|
|
package/src/login/surrogate.ts
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
adoptToken, clearSurrogate, markSurrogate, revokeToken, surrogatePath, LoginIntent, LoginOutcome,
|
|
3
|
-
LOGIN_LOGOUT_MESSAGE, LOGIN_SURROGATE_HEIGHT, LOGIN_SURROGATE_NAME, LOGIN_SURROGATE_WIDTH,
|
|
4
|
-
LOGIN_TOKEN_MESSAGE,
|
|
5
|
-
} from '@owlmeans/client-auth/login'
|
|
1
|
+
import { surrogatePath, LoginIntent, LoginOutcome, LOGIN_LOGOUT_MESSAGE, LOGIN_SURROGATE_HEIGHT, LOGIN_SURROGATE_NAME, LOGIN_SURROGATE_WIDTH, LOGIN_TOKEN_MESSAGE, loginEnvHelper, loginTokenOf } from '@owlmeans/client-auth/login'
|
|
6
2
|
import type { LoginContext, LoginEnv, LoginPlugin } from '@owlmeans/client-auth/login'
|
|
7
3
|
import { SURROGATE_LOGIN, SURROGATE_LOGIN_PRIORITY } from './consts.js'
|
|
8
4
|
import { awaitSurrogate } from './pump.js'
|
|
@@ -70,7 +66,7 @@ export const makeSurrogateLoginPlugin = (): LoginPlugin => {
|
|
|
70
66
|
return LoginOutcome.Orphaned
|
|
71
67
|
}
|
|
72
68
|
|
|
73
|
-
clearSurrogate()
|
|
69
|
+
loginEnvHelper.clearSurrogate()
|
|
74
70
|
// Both windows are the same origin (the surrogate is this application's own login route), so
|
|
75
71
|
// the origin is pinned rather than passed as `*` — the message carries a bearer token.
|
|
76
72
|
window.opener.postMessage({ type: LOGIN_TOKEN_MESSAGE, token }, window.location.origin)
|
|
@@ -85,7 +81,7 @@ export const makeSurrogateLoginPlugin = (): LoginPlugin => {
|
|
|
85
81
|
mode: 'surrogate',
|
|
86
82
|
match: env => env.hasWindow && (env.embedded || env.surrogate),
|
|
87
83
|
|
|
88
|
-
enter: () => { markSurrogate() },
|
|
84
|
+
enter: () => { loginEnvHelper.markSurrogate() },
|
|
89
85
|
|
|
90
86
|
begin: (ctx, request, env) => {
|
|
91
87
|
// Already one window up — nothing to open, just run the flow.
|
|
@@ -119,7 +115,7 @@ export const makeSurrogateLoginPlugin = (): LoginPlugin => {
|
|
|
119
115
|
if (data.token == null || data.token === '') {
|
|
120
116
|
return LoginOutcome.Failed
|
|
121
117
|
}
|
|
122
|
-
await
|
|
118
|
+
await loginTokenOf(ctx as LoginContext).adoptToken(data.token)
|
|
123
119
|
// Adopting the token is not the end of the flow — running the caller's continuation is,
|
|
124
120
|
// exactly as the redirect plugin does before it reports `Handled`. Without it the token
|
|
125
121
|
// lands in the auth service and nothing else happens: the framed app keeps rendering its
|
|
@@ -155,7 +151,7 @@ export const makeSurrogateLoginPlugin = (): LoginPlugin => {
|
|
|
155
151
|
logout: (ctx, request, env) => {
|
|
156
152
|
// Already one window up — end the session here and tell the opener.
|
|
157
153
|
if (env.surrogate) {
|
|
158
|
-
return
|
|
154
|
+
return loginTokenOf(ctx as LoginContext).revokeToken()
|
|
159
155
|
.then(async () => await plugin.logoutComplete!(ctx, env))
|
|
160
156
|
}
|
|
161
157
|
|
|
@@ -169,7 +165,7 @@ export const makeSurrogateLoginPlugin = (): LoginPlugin => {
|
|
|
169
165
|
// The local session goes next, and UNCONDITIONALLY. A blocked window, a severed opener or a
|
|
170
166
|
// user who closes the popup must never leave THIS document signed in: a logout that only
|
|
171
167
|
// half happened is bad, and one that did not happen at all is worse.
|
|
172
|
-
const local =
|
|
168
|
+
const local = loginTokenOf(ctx as LoginContext).revokeToken()
|
|
173
169
|
if (surrogate == null) {
|
|
174
170
|
// `path == null` is an app whose entrypoint list predates the surrogate route — nothing a
|
|
175
171
|
// retry would do differently. A `window.open` the browser refused is the one case worth
|
|
@@ -199,7 +195,7 @@ export const makeSurrogateLoginPlugin = (): LoginPlugin => {
|
|
|
199
195
|
if (!env.hasOpener) {
|
|
200
196
|
return LoginOutcome.Orphaned
|
|
201
197
|
}
|
|
202
|
-
clearSurrogate()
|
|
198
|
+
loginEnvHelper.clearSurrogate()
|
|
203
199
|
window.opener.postMessage({ type: LOGIN_LOGOUT_MESSAGE, ok: true }, window.location.origin)
|
|
204
200
|
window.close()
|
|
205
201
|
|
package/tests/surrogate.spec.ts
CHANGED
|
@@ -53,18 +53,21 @@ describe('centeredPopupFeatures', () => {
|
|
|
53
53
|
|
|
54
54
|
describe('surrogateLoginStep', () => {
|
|
55
55
|
test('a stored session is forgotten when there is a dispatcher to authenticate through', async () => {
|
|
56
|
-
const { surrogateLoginStep
|
|
56
|
+
const { surrogateLoginStep } = await import('../src/login/screen.js')
|
|
57
|
+
const { SurrogateLoginStep } = await import('../src/login/consts.js')
|
|
57
58
|
expect(surrogateLoginStep('OIDC-WRAPPED-TOKEN abc', '/dispatcher?x=1')).toBe(SurrogateLoginStep.Forget)
|
|
58
59
|
})
|
|
59
60
|
|
|
60
61
|
test('a stored session is handed back only when there is no dispatcher address', async () => {
|
|
61
|
-
const { surrogateLoginStep
|
|
62
|
+
const { surrogateLoginStep } = await import('../src/login/screen.js')
|
|
63
|
+
const { SurrogateLoginStep } = await import('../src/login/consts.js')
|
|
62
64
|
expect(surrogateLoginStep('OIDC-WRAPPED-TOKEN abc', null)).toBe(SurrogateLoginStep.Resume)
|
|
63
65
|
expect(surrogateLoginStep('OIDC-WRAPPED-TOKEN abc', '')).toBe(SurrogateLoginStep.Resume)
|
|
64
66
|
})
|
|
65
67
|
|
|
66
68
|
test('nothing stored authenticates, with or without a dispatcher address', async () => {
|
|
67
|
-
const { surrogateLoginStep
|
|
69
|
+
const { surrogateLoginStep } = await import('../src/login/screen.js')
|
|
70
|
+
const { SurrogateLoginStep } = await import('../src/login/consts.js')
|
|
68
71
|
expect(surrogateLoginStep(null, '/dispatcher')).toBe(SurrogateLoginStep.Authenticate)
|
|
69
72
|
expect(surrogateLoginStep('', null)).toBe(SurrogateLoginStep.Authenticate)
|
|
70
73
|
})
|