@owlmeans/mui-oidc-rp 0.1.18-rc.9 → 0.1.18
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 +34 -10
- package/agent-meta/manifest.json +16 -0
- package/agent-meta/skills/mui-oidc-rp/SKILL.md +155 -0
- package/build/auth/plugins/google-client.d.ts.map +1 -1
- package/build/auth/plugins/google-client.js +19 -14
- package/build/auth/plugins/google-client.js.map +1 -1
- package/build/auth/plugins/helpers/types.d.ts +16 -0
- package/build/auth/plugins/helpers/types.d.ts.map +1 -0
- package/build/auth/plugins/helpers/types.js +2 -0
- package/build/auth/plugins/helpers/types.js.map +1 -0
- package/build/auth/plugins/helpers.d.ts +3 -15
- package/build/auth/plugins/helpers.d.ts.map +1 -1
- package/build/auth/plugins/helpers.js +19 -27
- package/build/auth/plugins/helpers.js.map +1 -1
- package/build/auth/plugins/oidc-client.js +2 -2
- package/build/auth/plugins/oidc-client.js.map +1 -1
- package/build/components/dispatcher.d.ts +3 -1
- package/build/components/dispatcher.d.ts.map +1 -1
- package/build/components/dispatcher.js +36 -5
- package/build/components/dispatcher.js.map +1 -1
- package/build/guard.d.ts +5 -5
- package/build/guard.d.ts.map +1 -1
- package/build/guard.js +11 -8
- package/build/guard.js.map +1 -1
- package/build/service.js +5 -5
- package/build/service.js.map +1 -1
- package/build/types.d.ts +4 -1
- package/build/types.d.ts.map +1 -1
- package/package.json +19 -18
- package/src/auth/plugins/google-client.tsx +19 -14
- package/src/auth/plugins/helpers/types.ts +16 -0
- package/src/auth/plugins/helpers.ts +25 -31
- package/src/auth/plugins/oidc-client.tsx +2 -2
- package/src/components/dispatcher.tsx +55 -6
- package/src/guard.ts +14 -17
- package/src/service.ts +5 -5
- package/src/types.ts +8 -1
- package/tests/context.ts +1 -2
- package/tests/google-client.spec.ts +3 -1
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ Browser-side OIDC relying party — guard, auth service, and React components fo
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
7
7
|
- `appendOidcGuard(context)` — registers the OIDC guard on a web context
|
|
8
|
-
- `
|
|
8
|
+
- `oidcEntrypoints(extras?)` — returns local OIDC protocol bindings and the dispatcher screen
|
|
9
9
|
- `makeOidcAuthService(alias?)` — browser-side OIDC auth service (built on `oidc-client-ts`)
|
|
10
10
|
- React components for login and callback handling
|
|
11
11
|
- `OidcAuthPurposes` enum — `Unknown` | `Subscribe` | `Login`
|
|
@@ -13,7 +13,7 @@ Browser-side OIDC relying party — guard, auth service, and React components fo
|
|
|
13
13
|
## Installation
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
-
bun add @owlmeans/mui-oidc-rp
|
|
16
|
+
bun add @owlmeans/mui-oidc-rp@^0.1.18
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
## Usage
|
|
@@ -31,12 +31,17 @@ export const makeContext = <C extends Config, T extends Context<C>>(cfg: C): T =
|
|
|
31
31
|
}
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
Decorate shared declarations immutably, then bind OIDC in the MUI runtime:
|
|
35
35
|
|
|
36
36
|
```typescript
|
|
37
|
-
import {
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
import { withOidcGuard } from '@owlmeans/oidc'
|
|
38
|
+
import { oidcEntrypoints } from '@owlmeans/mui-oidc-rp'
|
|
39
|
+
|
|
40
|
+
const configuredProtocols = withOidcGuard(protocols)
|
|
41
|
+
const clientBindings = [
|
|
42
|
+
// Bind application screens and clients against configuredProtocols here.
|
|
43
|
+
...oidcEntrypoints({ payload: { simplified: true } }),
|
|
44
|
+
]
|
|
40
45
|
```
|
|
41
46
|
|
|
42
47
|
## API
|
|
@@ -45,9 +50,12 @@ setupOidcGuard(modules, undefined, { payload: { simplified: true } })
|
|
|
45
50
|
|
|
46
51
|
Registers the OIDC guard service on the web context.
|
|
47
52
|
|
|
48
|
-
### `
|
|
53
|
+
### `oidcEntrypoints(extras?)`
|
|
49
54
|
|
|
50
|
-
|
|
55
|
+
Returns browser-local bindings for the shared OIDC protocols and dispatcher screen. Decorate the
|
|
56
|
+
shared protocol tree with `withOidcGuard(protocols, coguards?)` from `@owlmeans/oidc`; neither
|
|
57
|
+
function mutates declarations or a materialized entrypoint list. `extras` overrides parametrised
|
|
58
|
+
dispatcher props (for example `payload.simplified`).
|
|
51
59
|
|
|
52
60
|
### `makeOidcAuthService(alias?): OidcAuthService`
|
|
53
61
|
|
|
@@ -67,11 +75,27 @@ Login and callback React components exported from `./components` (re-exported at
|
|
|
67
75
|
- Import `@owlmeans/mui-oidc-rp/auth/plugins` for side effects to register `OIDC_CLIENT_AUTH` and `GOOGLE_CLIENT_AUTH` with `@owlmeans/client-auth`.
|
|
68
76
|
- The Google plugin uses `useValue`, persists auth control state before redirect, restores it on return, and submits URL query params as `AuthCredentials`.
|
|
69
77
|
- The browser starts login; the server exchanges provider code, links local identity, and returns a normal bearer token.
|
|
70
|
-
- Keep product authorization server-side through
|
|
78
|
+
- Keep product authorization server-side through entrypoint gates and identity profile scopes.
|
|
71
79
|
|
|
72
80
|
## Related Packages
|
|
73
81
|
|
|
74
|
-
- [`@owlmeans/oidc`](../oidc) — shared `OIDC_GATE`, `OIDC_GUARD`, dispatcher
|
|
82
|
+
- [`@owlmeans/oidc`](../oidc) — shared `OIDC_GATE`, `OIDC_GUARD`, dispatcher entrypoints
|
|
75
83
|
- [`@owlmeans/web-client`](../web-client) — base web context this guard plugs into
|
|
76
84
|
- [`@owlmeans/mui-panel`](../mui-panel) — `makeContext` typically used as the base
|
|
77
85
|
- [`@owlmeans/client-auth`](../client-auth) — auth manager primitives the guard interacts with
|
|
86
|
+
|
|
87
|
+
<!-- owlmeans:agent-guidance:start -->
|
|
88
|
+
## Agent guidance
|
|
89
|
+
|
|
90
|
+
This package ships embedded agent skills under `agent-meta/`. After installing your
|
|
91
|
+
`@owlmeans/*` packages, run the OwlMeans agent-skills installer to place them into
|
|
92
|
+
your project's skill store (`.agents/skills/`):
|
|
93
|
+
|
|
94
|
+
```sh
|
|
95
|
+
npx @owlmeans/agent-skills@^0.1.18
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
The embedded files are version-matched to this package release. Do not edit them
|
|
99
|
+
directly — they are regenerated on each publish. To contribute guidance edits,
|
|
100
|
+
open a PR against the source monorepo.
|
|
101
|
+
<!-- owlmeans:agent-guidance:end -->
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 3,
|
|
3
|
+
"package": "@owlmeans/mui-oidc-rp",
|
|
4
|
+
"version": "0.1.18",
|
|
5
|
+
"generatedAt": "2026-10-28T00:31:34.770Z",
|
|
6
|
+
"canonicalRepo": "https://github.com/owlmeans/common",
|
|
7
|
+
"entries": [
|
|
8
|
+
{
|
|
9
|
+
"kind": "skill",
|
|
10
|
+
"name": "mui-oidc-rp",
|
|
11
|
+
"category": "package-specific",
|
|
12
|
+
"file": "skills/mui-oidc-rp/SKILL.md",
|
|
13
|
+
"canonicalPath": ".agents/skills/mui-oidc-rp/SKILL.md"
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mui-oidc-rp
|
|
3
|
+
description: "How to use @owlmeans/mui-oidc-rp — the LEGACY MUI browser OIDC relying party: appendOidcGuard, oidcEntrypoints, the OidcAuthService round trip and the Dispatcher screen, plus the OIDC and Google client-auth plugins. Superseded by @owlmeans/web-oidc-rp (or @owlmeans/client-iam) for new work. Auto-invoked when maintaining an app that already imports mui-oidc-rp or migrating one off it."
|
|
4
|
+
user-invocable: false
|
|
5
|
+
---
|
|
6
|
+
<!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
|
|
7
|
+
|
|
8
|
+
# @owlmeans/mui-oidc-rp
|
|
9
|
+
|
|
10
|
+
**Layer:** Web (React)
|
|
11
|
+
**Install:** `"@owlmeans/mui-oidc-rp": "^0.1.18"` in `dependencies`
|
|
12
|
+
|
|
13
|
+
## This is the legacy relying party
|
|
14
|
+
|
|
15
|
+
**`@owlmeans/web-oidc-rp` is the current browser OIDC relying party**, and `@owlmeans/client-iam`
|
|
16
|
+
wraps it with `appendIam`, `withIamGuard` and `iamEntrypoints`, which also install the
|
|
17
|
+
consent-before-sign-in precondition. Use those for new work. This package is the MUI-family predecessor, kept for the
|
|
18
|
+
applications already built on `@owlmeans/mui-panel`.
|
|
19
|
+
|
|
20
|
+
The two are wire-compatible: same guard aliases, same dispatcher entrypoints, same
|
|
21
|
+
`@owlmeans/oidc` constants, same server side. The difference is behavioural, not cosmetic — **this
|
|
22
|
+
dispatcher starts the authorization itself and never defers to a method chooser**, where the current
|
|
23
|
+
one offers the sign-in method screen.
|
|
24
|
+
|
|
25
|
+
The MUI in the name is only the two client-auth plugins behind `./auth/plugins` — the OIDC one and
|
|
26
|
+
the Google one, each rendering a `LinearProgress`. The `Dispatcher` itself imports no MUI at all —
|
|
27
|
+
plain `<div>`/`<button>` plus `LoginSurrogateView` from `@owlmeans/web-client`, the same primitives
|
|
28
|
+
the current dispatcher uses.
|
|
29
|
+
|
|
30
|
+
**Migrating is more than swapping a screen.** `@owlmeans/web-oidc-rp`'s `appendOidcGuard` also calls
|
|
31
|
+
`ensureLoginService(ctx).registerMethodSource(oidcMethodSource)`, which is what puts the configured
|
|
32
|
+
identity providers in front of the method chooser — without that registration the chooser has
|
|
33
|
+
nothing to offer. That package additionally exports `OIDC_LOGIN_METHOD` and the surrogate-window
|
|
34
|
+
constants (`OIDC_POPUP_NAME`, `OIDC_POPUP_TOKEN`, `OIDC_POPUP_FEATURES`, `OIDC_POPUP_MARKER`,
|
|
35
|
+
`OIDC_POPUP_WATCH_INTERVAL`, re-exported under their original names from
|
|
36
|
+
`@owlmeans/client-auth/login`), which have no counterpart here.
|
|
37
|
+
|
|
38
|
+
## Key Exports
|
|
39
|
+
|
|
40
|
+
| Export | Description |
|
|
41
|
+
|--------|-------------|
|
|
42
|
+
| `appendOidcGuard<C, T>(context, opts?)` | Registers `OidcAuthService` and the OIDC guard on a web context |
|
|
43
|
+
| `oidcEntrypoints(extras?)` | Browser-local bindings for shared OIDC protocols and the dispatcher screen |
|
|
44
|
+
| `makeOidcAuthService(alias?)` | The browser auth service — `dispatch`, `authenticate`, `proceedToRedirectUrl` |
|
|
45
|
+
| `Dispatcher` | The redirect-URI screen, wrapped in `DispatcherHOC` |
|
|
46
|
+
| `OidcAuthService` / `OidcAuthRedirectExtras` / `OidcPostAuthPayload` / `OidcInteraction` | The service and payload shapes |
|
|
47
|
+
| `OidcAuthPurposes` | `Unknown` / `Subscribe` / `Login` — what the round trip is for |
|
|
48
|
+
| `DEFAULT_ALIAS` | `'oidc-rp'`, the service alias |
|
|
49
|
+
|
|
50
|
+
## Subpath Exports
|
|
51
|
+
|
|
52
|
+
- `./auth/plugins` — imported **for its side effects**: it registers `OIDC_CLIENT_AUTH` and
|
|
53
|
+
`GOOGLE_CLIENT_AUTH` into the shared plugin registry of `@owlmeans/client-auth/manager`. The
|
|
54
|
+
registry is a module singleton, so importing this alongside another family's plugins replaces
|
|
55
|
+
entries rather than merging them.
|
|
56
|
+
|
|
57
|
+
## Wiring
|
|
58
|
+
|
|
59
|
+
```typescript
|
|
60
|
+
import { makeContext as makeBasicContext } from '@owlmeans/mui-panel'
|
|
61
|
+
import { appendOidcGuard, oidcEntrypoints } from '@owlmeans/mui-oidc-rp'
|
|
62
|
+
|
|
63
|
+
export const makeContext = <C extends Config, T extends Context<C>>(cfg: C): T => {
|
|
64
|
+
const context = makeBasicContext<C, T>(cfg) as T
|
|
65
|
+
appendOidcGuard<C, T>(context)
|
|
66
|
+
return context
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export const clientBindings = [
|
|
70
|
+
...bindAll(appProtocols.api),
|
|
71
|
+
...oidcEntrypoints({ payload: { simplified: 'true' } }),
|
|
72
|
+
]
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
`oidcEntrypoints()` returns local bindings. Spread it once into an immutable browser entrypoint
|
|
76
|
+
list; the shared OIDC declarations remain in the app's protocol tree and are never appended or
|
|
77
|
+
mutated here.
|
|
78
|
+
|
|
79
|
+
`coguards` composes the OIDC guard with another guard alias. `extras` parametrises the dispatcher
|
|
80
|
+
component; its `payload` is merged into the flow payload the dispatcher carries onward.
|
|
81
|
+
|
|
82
|
+
**The simplified-flow flag is the string `'true'`, never the boolean.** `OidcAuthRedirectExtras`
|
|
83
|
+
declares `simplified?: string`, and the service tests `flow.payload().simplified === 'true'` before
|
|
84
|
+
it appends `&simplified=true` to the provider URL. `FlowPayload` accepts booleans too, so
|
|
85
|
+
`{ simplified: true }` compiles and then never matches — the simplified flow is silently off with
|
|
86
|
+
no error anywhere. `@owlmeans/web-oidc-rp` and `@owlmeans/web-oidc-provider` compare the same way.
|
|
87
|
+
|
|
88
|
+
## The round trip
|
|
89
|
+
|
|
90
|
+
Three service methods, in the order the browser meets them:
|
|
91
|
+
|
|
92
|
+
1. **`authenticate(flow, params)`** — only acts when the flow is `STD_OIDC_FLOW` at the
|
|
93
|
+
`OidcAuthStep.Ephemeral` step and an organization entity is known (from `params.entity` or the
|
|
94
|
+
flow's own `entityId`); otherwise it answers `null`. It calls `DISPATCHER_OIDC_INIT` on the
|
|
95
|
+
server, gets the provider URL back, **stores that URL in the auth store** under a fixed key, and
|
|
96
|
+
returns it for the caller to navigate to.
|
|
97
|
+
2. The provider returns the browser to the `DISPATCHER` entrypoint — the redirect URI.
|
|
98
|
+
3. **`dispatch(params)`** — returns `false` immediately when the query carries no `OIDC_CODE_QUERY`.
|
|
99
|
+
Otherwise it reads the stored `authUrl` back, posts the whole query to `DISPATCHER_OIDC`, and on
|
|
100
|
+
a non-empty token calls `adoptToken`. **The browser starts the login; the server exchanges the
|
|
101
|
+
provider code, links the local identity and returns an ordinary bearer token** — no product
|
|
102
|
+
authorization is decided here, it stays server-side in entrypoint gates and profile scopes.
|
|
103
|
+
|
|
104
|
+
`proceedToRedirectUrl(extras)` drives the flow model forward instead, for the surfaces that hand
|
|
105
|
+
the user onward through the flow rather than straight to the provider.
|
|
106
|
+
|
|
107
|
+
## Gotchas
|
|
108
|
+
|
|
109
|
+
- **The provider reports failure by redirecting BACK to the dispatcher with `error` set.**
|
|
110
|
+
`OIDC_ERROR_QUERY` / `OIDC_ERROR_DESCRIPTION_QUERY` (from `@owlmeans/oidc`) must be checked
|
|
111
|
+
**before** re-entering the flow. Re-entering rebuilds the authorization request that just failed,
|
|
112
|
+
so the browser bounces between dispatcher and provider forever and the real reason never reaches
|
|
113
|
+
the user. The `Dispatcher` here does that check first and renders the message; keep it that way in
|
|
114
|
+
any replacement.
|
|
115
|
+
- **`context.login().enter()` is the first statement in the dispatcher's effect, on purpose.**
|
|
116
|
+
Everything after it can navigate the window to the provider, and once that happens the evidence of
|
|
117
|
+
what this window was is gone.
|
|
118
|
+
- **The environment is read in the component body, not in an effect.** `window.name` is set before
|
|
119
|
+
the document loads and `sessionStorage` carries the marker across the provider round trip, so the
|
|
120
|
+
answer is already right at first paint — reading it in an effect flashes the application inside a
|
|
121
|
+
surrogate window before the effect corrects it.
|
|
122
|
+
- **A surrogate window never renders the application**, whatever else is true; that branch is
|
|
123
|
+
checked ahead of every other return. Where the round trip actually runs — same tab, popup, framed
|
|
124
|
+
logout — is not this package's decision: it belongs to the login plugin the framework selected.
|
|
125
|
+
- **The dispatcher's effect has no once-only guard.** It is keyed `[client, error]`, and `client`
|
|
126
|
+
comes from `useFlow`, which builds a fresh `FlowClient` whenever its own inputs re-resolve — so the
|
|
127
|
+
effect can run more than once for one page. The PKCE verifier and the authorization code are
|
|
128
|
+
single-use, so a second run repeats an exchange that can only fail. `@owlmeans/web-oidc-rp` carries
|
|
129
|
+
a `dispatchedRef` for exactly this; if a maintained app hits a spurious dispatch failure here, that
|
|
130
|
+
is the shape of it.
|
|
131
|
+
- **`dispatchClientOnly` is unfinished.** It stops at the redirect to the provider because a
|
|
132
|
+
browser-only implementation needs integrated cryptography over TLS, and its `client_id` is empty.
|
|
133
|
+
Do not wire it into an application.
|
|
134
|
+
- `oidc-client-ts` is pinned exactly (`3.5.0`), like every other OIDC dependency in the framework —
|
|
135
|
+
bump it only through the version-upgrade checklist.
|
|
136
|
+
|
|
137
|
+
## Depends On
|
|
138
|
+
|
|
139
|
+
- `@owlmeans/oidc` — the guard, the dispatcher entrypoint aliases, the query-parameter constants
|
|
140
|
+
- `@owlmeans/web-client` — the browser context and dispatcher parametrisation
|
|
141
|
+
- `@mui/material` (`^7`) and `react` — **peer** dependencies; the host application supplies both.
|
|
142
|
+
This package does not depend on `@owlmeans/mui-panel`; it only renders comfortably beside it
|
|
143
|
+
- `@owlmeans/client-auth` — `DispatcherHOC`, the plugin registry, `adoptToken`
|
|
144
|
+
- `@owlmeans/client-flow` / `@owlmeans/web-flow` / `@owlmeans/flow` — the flow model the round trip
|
|
145
|
+
advances
|
|
146
|
+
- `@owlmeans/basic-envelope` — opening the signed challenge the Google plugin receives
|
|
147
|
+
|
|
148
|
+
## Related
|
|
149
|
+
|
|
150
|
+
- `web-oidc-rp` — **the current relying party**; read it for anything new
|
|
151
|
+
- `iam` and the `client-iam` one-call wiring — how an application wires sign-in today
|
|
152
|
+
- `login-plugins` (WHERE the round trip runs) and `login-methods` (WHICH method is offered) — read
|
|
153
|
+
both before touching any dispatcher
|
|
154
|
+
- `mui-panel` — the legacy panel family this one belongs to
|
|
155
|
+
- `oidc-versions` — the exact-pin policy for `oidc-client-ts` and its siblings
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"google-client.d.ts","sourceRoot":"","sources":["../../../src/auth/plugins/google-client.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAA;AAYjF,eAAO,MAAM,kBAAkB,EAAE,
|
|
1
|
+
{"version":3,"file":"google-client.d.ts","sourceRoot":"","sources":["../../../src/auth/plugins/google-client.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAA;AAYjF,eAAO,MAAM,kBAAkB,EAAE,oBAqFhC,CAAA"}
|
|
@@ -3,9 +3,9 @@ import { AuthenticationStage, CAUTHEN_AUTHEN_TYPED } from '@owlmeans/auth';
|
|
|
3
3
|
import { DEFAULT_ALIAS as AUTH_SERVICE } from '@owlmeans/client-auth';
|
|
4
4
|
import { GOOGLE_CLIENT_AUTH } from '@owlmeans/oidc';
|
|
5
5
|
import { useContext, useValue } from '@owlmeans/client';
|
|
6
|
-
import {
|
|
6
|
+
import { loginLandingOf } from '@owlmeans/client-auth/login';
|
|
7
7
|
import LinearProgress from '@mui/material/LinearProgress';
|
|
8
|
-
import {
|
|
8
|
+
import { googleClientHelper } from './helpers.js';
|
|
9
9
|
export const googleClientPlugin = {
|
|
10
10
|
type: GOOGLE_CLIENT_AUTH,
|
|
11
11
|
Implementation: Renderer => ({ type, stage, control }) => {
|
|
@@ -24,23 +24,28 @@ export const googleClientPlugin = {
|
|
|
24
24
|
const url = new URL(window.location.href);
|
|
25
25
|
const code = url.searchParams.get('code');
|
|
26
26
|
if (code != null) {
|
|
27
|
-
const auth = buildCallbackCredentials(url.searchParams.toString(), type, control.allowance?.challenge ?? '');
|
|
27
|
+
const auth = googleClientHelper.buildCallbackCredentials(url.searchParams.toString(), type, control.allowance?.challenge ?? '');
|
|
28
28
|
const token = await control.authenticate(auth);
|
|
29
29
|
if (token.token !== '') {
|
|
30
30
|
const authService = context.service(AUTH_SERVICE);
|
|
31
31
|
await authService.authenticate(token);
|
|
32
32
|
}
|
|
33
|
-
//
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
// A registered step (marketing consent, say) or a device/authorization-code
|
|
34
|
+
// consent screen that suspended itself here before sending the browser to sign in
|
|
35
|
+
// both take priority over the app's own home — `landAfterLogin` is the whole
|
|
36
|
+
// decision. This closes a gap the MUI relying party carried before: it used to go
|
|
37
|
+
// straight to HOME with no suspended-landing check at all.
|
|
38
|
+
const landings = loginLandingOf(context);
|
|
39
|
+
const landing = await landings.landAfterLogin();
|
|
40
|
+
window.location.href = await landings.landingUrl(landing);
|
|
36
41
|
return;
|
|
37
42
|
}
|
|
38
43
|
}
|
|
39
44
|
// Initial request — ask server for Google auth URL
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
await control.requestAllowence({ type, source
|
|
45
|
+
const source = await context.entrypoint(CAUTHEN_AUTHEN_TYPED).url({
|
|
46
|
+
params: { type }
|
|
47
|
+
}, { absolute: true });
|
|
48
|
+
await control.requestAllowence({ type, source });
|
|
44
49
|
break;
|
|
45
50
|
}
|
|
46
51
|
case AuthenticationStage.Authenticate: {
|
|
@@ -48,10 +53,10 @@ export const googleClientPlugin = {
|
|
|
48
53
|
return;
|
|
49
54
|
if (control.allowance?.challenge != null) {
|
|
50
55
|
// The server wraps challenge as "source:googleUrl" — extract the URL part
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
const url = extractGoogleUrl(control.allowance.challenge, source
|
|
56
|
+
const source = await context.entrypoint(CAUTHEN_AUTHEN_TYPED).url({
|
|
57
|
+
params: { type }
|
|
58
|
+
}, { absolute: true });
|
|
59
|
+
const url = googleClientHelper.extractGoogleUrl(control.allowance.challenge, source);
|
|
55
60
|
// Persist control state before redirect
|
|
56
61
|
await control.persist();
|
|
57
62
|
// Redirect to Google
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"google-client.js","sourceRoot":"","sources":["../../../src/auth/plugins/google-client.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AAE1E,OAAO,EAAE,aAAa,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAErE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AACnD,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AACvD,OAAO,EAAE,
|
|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AI,MAAM,EAAE,OAAO;wBAAE,OAAM;oBAE3B,IAAI,OAAO,CAAC,SAAS,EAAE,SAAS,IAAI,IAAI,EAAE,CAAC;wBACzC,0EAA0E;wBAC1E,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,UAAU,CAAiB,oBAAoB,CAAC,CAAC,GAAG,CAAC;4BAChF,MAAM,EAAE,EAAE,IAAI,EAAE;yBACjB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;wBACtB,MAAM,GAAG,GAAG,kBAAkB,CAAC,gBAAgB,CAAC,OAAO,CAAC,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC,CAAA;wBAEpF,wCAAwC;wBACxC,MAAM,OAAO,CAAC,OAAO,EAAE,CAAA;wBAEvB,qBAAqB;wBACrB,QAAQ,CAAC,QAAQ,CAAC,IAAI,GAAG,GAAG,CAAA;oBAC9B,CAAC;oBACD,MAAK;gBACP,CAAC;YACH,CAAC;QACH,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAA;QAEjB,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;YACrB,MAAM,IAAI,WAAW,CAAC,2CAA2C,CAAC,CAAA;QACpE,CAAC;QAED,OAAO,KAAC,QAAQ,IAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,GAAI,CAAA;IAC7E,CAAC;IAED,QAAQ,EAAE,GAAG,EAAE,CAAC,KAAC,cAAc,KAAG;CACnC,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { AuthCredentials } from '@owlmeans/auth';
|
|
2
|
+
/**
|
|
3
|
+
* Pure helpers extracted from the Google client plugin for unit-testability.
|
|
4
|
+
* These perform the URL/challenge processing logic that doesn't depend on React.
|
|
5
|
+
*/
|
|
6
|
+
export interface GoogleClientHelper {
|
|
7
|
+
/**
|
|
8
|
+
* Extract the Google auth URL from a signed challenge envelope message.
|
|
9
|
+
* The server wraps the challenge as "source:googleUrl" — this strips the source prefix.
|
|
10
|
+
* Also handles raw Google URLs (rolling deployment compatibility).
|
|
11
|
+
*/
|
|
12
|
+
extractGoogleUrl: (envelopeChallenge: string, sourcePrefix: string) => string;
|
|
13
|
+
/** Build AuthCredentials from the Google callback URL query params. */
|
|
14
|
+
buildCallbackCredentials: (queryString: string, type: string, challenge: string) => AuthCredentials;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/auth/plugins/helpers/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAErD;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;;OAIG;IACH,gBAAgB,EAAE,CAAC,iBAAiB,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,KAAK,MAAM,CAAA;IAC7E,uEAAuE;IACvE,wBAAwB,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,eAAe,CAAA;CACpG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/auth/plugins/helpers/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,16 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*/
|
|
5
|
-
import type { AuthCredentials } from '@owlmeans/auth';
|
|
6
|
-
/**
|
|
7
|
-
* Extract the Google auth URL from a signed challenge envelope message.
|
|
8
|
-
* The server wraps the challenge as "source:googleUrl" — this strips the source prefix.
|
|
9
|
-
* Also handles raw Google URLs (rolling deployment compatibility).
|
|
10
|
-
*/
|
|
11
|
-
export declare const extractGoogleUrl: (envelopeChallenge: string, sourcePrefix: string) => string;
|
|
12
|
-
/**
|
|
13
|
-
* Build AuthCredentials from the Google callback URL query params.
|
|
14
|
-
*/
|
|
15
|
-
export declare const buildCallbackCredentials: (queryString: string, type: string, challenge: string) => AuthCredentials;
|
|
1
|
+
import type { GoogleClientHelper } from './helpers/types.js';
|
|
2
|
+
export declare const createGoogleClientHelper: () => GoogleClientHelper;
|
|
3
|
+
export declare const googleClientHelper: GoogleClientHelper;
|
|
16
4
|
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/auth/plugins/helpers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/auth/plugins/helpers.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAE5D,eAAO,MAAM,wBAAwB,QAAO,kBAyB3C,CAAA;AAED,eAAO,MAAM,kBAAkB,oBAA6B,CAAA"}
|
|
@@ -1,31 +1,23 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pure helpers extracted from the Google client plugin for unit-testability.
|
|
3
|
-
* These perform the URL/challenge processing logic that doesn't depend on React.
|
|
4
|
-
*/
|
|
5
1
|
import { EnvelopeKind, makeEnvelopeModel } from '@owlmeans/basic-envelope';
|
|
6
2
|
import { AUTH_SCOPE, AuthRole } from '@owlmeans/auth';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
3
|
+
export const createGoogleClientHelper = () => {
|
|
4
|
+
const extractGoogleUrl = (envelopeChallenge, sourcePrefix) => {
|
|
5
|
+
const envelope = makeEnvelopeModel(envelopeChallenge, EnvelopeKind.Wrap);
|
|
6
|
+
const msg = envelope.message(true);
|
|
7
|
+
if (msg.startsWith(sourcePrefix + ':')) {
|
|
8
|
+
return msg.slice(sourcePrefix.length + 1);
|
|
9
|
+
}
|
|
10
|
+
return msg;
|
|
11
|
+
};
|
|
12
|
+
const buildCallbackCredentials = (queryString, type, challenge) => ({
|
|
13
|
+
type,
|
|
14
|
+
challenge,
|
|
15
|
+
credential: queryString,
|
|
16
|
+
role: AuthRole.User,
|
|
17
|
+
userId: 'code',
|
|
18
|
+
scopes: [AUTH_SCOPE],
|
|
19
|
+
});
|
|
20
|
+
return { extractGoogleUrl, buildCallbackCredentials };
|
|
19
21
|
};
|
|
20
|
-
|
|
21
|
-
* Build AuthCredentials from the Google callback URL query params.
|
|
22
|
-
*/
|
|
23
|
-
export const buildCallbackCredentials = (queryString, type, challenge) => ({
|
|
24
|
-
type,
|
|
25
|
-
challenge,
|
|
26
|
-
credential: queryString,
|
|
27
|
-
role: AuthRole.User,
|
|
28
|
-
userId: 'code',
|
|
29
|
-
scopes: [AUTH_SCOPE],
|
|
30
|
-
});
|
|
22
|
+
export const googleClientHelper = createGoogleClientHelper();
|
|
31
23
|
//# sourceMappingURL=helpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/auth/plugins/helpers.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/auth/plugins/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC1E,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAIrD,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAuB,EAAE;IAC/D,MAAM,gBAAgB,GAAG,CAAC,iBAAyB,EAAE,YAAoB,EAAU,EAAE;QACnF,MAAM,QAAQ,GAAG,iBAAiB,CAAC,iBAAiB,EAAE,YAAY,CAAC,IAAI,CAAC,CAAA;QACxE,MAAM,GAAG,GAAG,QAAQ,CAAC,OAAO,CAAS,IAAI,CAAC,CAAA;QAE1C,IAAI,GAAG,CAAC,UAAU,CAAC,YAAY,GAAG,GAAG,CAAC,EAAE,CAAC;YACvC,OAAO,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;QAC3C,CAAC;QACD,OAAO,GAAG,CAAA;IACZ,CAAC,CAAA;IAED,MAAM,wBAAwB,GAAG,CAC/B,WAAmB,EACnB,IAAY,EACZ,SAAiB,EACA,EAAE,CAAC,CAAC;QACrB,IAAI;QACJ,SAAS;QACT,UAAU,EAAE,WAAW;QACvB,IAAI,EAAE,QAAQ,CAAC,IAAI;QACnB,MAAM,EAAE,MAAM;QACd,MAAM,EAAE,CAAC,UAAU,CAAC;KACrB,CAAC,CAAA;IAEF,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,CAAA;AACvD,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,wBAAwB,EAAE,CAAA"}
|
|
@@ -7,13 +7,13 @@ import { EnvelopeKind, makeEnvelopeModel } from '@owlmeans/basic-envelope';
|
|
|
7
7
|
import { useContext } from '@owlmeans/web-client';
|
|
8
8
|
import { DEFAULT_ALIAS, OidcAuthPurposes } from '../../consts.js';
|
|
9
9
|
import { OidcAuthStep, OidpAuthStep, UnknownFlowStep } from '@owlmeans/flow';
|
|
10
|
-
import {
|
|
10
|
+
import { useEntrypoint } from '@owlmeans/client';
|
|
11
11
|
export const oidcClientPlugin = {
|
|
12
12
|
type: OIDC_CLIENT_AUTH,
|
|
13
13
|
Implementation: Renderer => ({ type, stage, control }) => {
|
|
14
14
|
const context = useContext();
|
|
15
15
|
Renderer = Renderer ?? oidcClientPlugin.Renderer;
|
|
16
|
-
const module =
|
|
16
|
+
const module = useEntrypoint();
|
|
17
17
|
useEffect(() => {
|
|
18
18
|
let canceled = false;
|
|
19
19
|
// @TODO extract somewhere else and make it more consequential
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oidc-client.js","sourceRoot":"","sources":["../../../src/auth/plugins/oidc-client.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAE5F,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,cAAc,MAAM,8BAA8B,CAAA;AACzD,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAE1E,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AACjE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAC5E,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"oidc-client.js","sourceRoot":"","sources":["../../../src/auth/plugins/oidc-client.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAE5F,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,cAAc,MAAM,8BAA8B,CAAA;AACzD,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAE1E,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AACjE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAk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AI,EAAE,CAAC;YACrB,MAAM,IAAI,WAAW,CAAC,yCAAyC,CAAC,CAAA;QAClE,CAAC;QAED,OAAO,KAAC,QAAQ,IAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,GAAI,CAAA;IACxF,CAAC;IAED,QAAQ,EAAE,GAAG,EAAE,CAAC,KAAC,cAAc,KAAG;CACnC,CAAA"}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import type { DispatcherProps } from '@owlmeans/client-auth';
|
|
2
|
+
import type { RoutedComponent } from '@owlmeans/client';
|
|
3
|
+
export declare const Dispatcher: RoutedComponent<DispatcherProps>;
|
|
2
4
|
//# sourceMappingURL=dispatcher.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dispatcher.d.ts","sourceRoot":"","sources":["../../src/components/dispatcher.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dispatcher.d.ts","sourceRoot":"","sources":["../../src/components/dispatcher.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAiBvD,eAAO,MAAM,UAAU,EAAE,eAAe,CAAC,eAAe,CAiJtD,CAAA"}
|
|
@@ -7,12 +7,21 @@ import { AUTH_QUERY } from '@owlmeans/auth';
|
|
|
7
7
|
import { OIDC_ERROR_DESCRIPTION_QUERY, OIDC_ERROR_QUERY } from '@owlmeans/oidc';
|
|
8
8
|
import { useFlow } from '@owlmeans/web-flow';
|
|
9
9
|
import { DEFAULT_ALIAS } from '../consts.js';
|
|
10
|
-
import { LoginOutcome } from '@owlmeans/client-auth/login';
|
|
10
|
+
import { LoginIntent, LoginOutcome, ResumeAction, loginResumeHelper, } from '@owlmeans/client-auth/login';
|
|
11
|
+
import { LoginSurrogateView, SurrogateStage } from '@owlmeans/web-client';
|
|
12
|
+
import { logger } from '@owlmeans/log';
|
|
13
|
+
const log = logger('mui-oidc-rp');
|
|
11
14
|
export const Dispatcher = DispatcherHOC(({ provideToken, navigate }) => {
|
|
12
15
|
const context = useContext();
|
|
13
16
|
const [query] = context.router().useSearchParams();
|
|
14
17
|
const client = useFlow();
|
|
15
18
|
const t = useI18nLib('auth', 'dispatcher');
|
|
19
|
+
const tAuth = useI18nLib('auth');
|
|
20
|
+
// Read in the component body, not in the effect: `window.name` is set before this document
|
|
21
|
+
// loads and `sessionStorage` carries the marker across the provider round trip, so the answer
|
|
22
|
+
// is already right at first paint — and a popup that flashes the application before an effect
|
|
23
|
+
// corrects it is the defect this exists to prevent.
|
|
24
|
+
const [env] = useState(() => context.login().env());
|
|
16
25
|
// The provider reports a failed authorization by redirecting BACK here with `error` set. Re-entering
|
|
17
26
|
// the flow at that point sends the browser into the very authorization request that just failed —
|
|
18
27
|
// an endless dispatcher <-> provider redirect loop that also hides the reason. Surface it, stop.
|
|
@@ -35,7 +44,7 @@ export const Dispatcher = DispatcherHOC(({ provideToken, navigate }) => {
|
|
|
35
44
|
return;
|
|
36
45
|
}
|
|
37
46
|
if (error != null) {
|
|
38
|
-
|
|
47
|
+
log.warn('Authorization refused by the provider', { reason: error, description: errorDescription }, { event: 'auth.refused' });
|
|
39
48
|
return;
|
|
40
49
|
}
|
|
41
50
|
const token = query.get(AUTH_QUERY);
|
|
@@ -78,15 +87,37 @@ export const Dispatcher = DispatcherHOC(({ provideToken, navigate }) => {
|
|
|
78
87
|
return;
|
|
79
88
|
}
|
|
80
89
|
const authzToken = await context.auth().authenticated();
|
|
81
|
-
if (authzToken == null) {
|
|
90
|
+
if (authzToken == null || authzToken === '') {
|
|
82
91
|
provideToken({ token: '' }, undefined);
|
|
92
|
+
return;
|
|
83
93
|
}
|
|
84
|
-
|
|
85
|
-
|
|
94
|
+
// A session already exists in THIS document. Whether it is useful here, or belongs to the
|
|
95
|
+
// window that opened this one, is the plugin's call — the dispatcher reads no environment.
|
|
96
|
+
const settled = await context.login().resume(authzToken);
|
|
97
|
+
switch (loginResumeHelper.resumeAction(settled)) {
|
|
98
|
+
case ResumeAction.Stop:
|
|
99
|
+
return;
|
|
100
|
+
case ResumeAction.Render:
|
|
101
|
+
setOutcome(settled);
|
|
102
|
+
return;
|
|
103
|
+
default:
|
|
104
|
+
await navigate();
|
|
86
105
|
}
|
|
87
106
|
});
|
|
88
107
|
}
|
|
89
108
|
}, [client, error]);
|
|
109
|
+
// A surrogate window never renders the application, whatever else is true — checked ahead of
|
|
110
|
+
// every other return for exactly that reason.
|
|
111
|
+
//
|
|
112
|
+
// Unlike `web-oidc-rp`, this dispatcher never defers to a method chooser — it starts the
|
|
113
|
+
// authorization itself — so there is no state here that the surrogate panel could mask.
|
|
114
|
+
if (env.surrogate) {
|
|
115
|
+
return _jsx(LoginSurrogateView, { intent: LoginIntent.Login, stage: error != null ? SurrogateStage.Failed
|
|
116
|
+
: outcome === LoginOutcome.Orphaned ? SurrogateStage.Orphaned
|
|
117
|
+
: outcome === LoginOutcome.Gesture ? SurrogateStage.Gesture
|
|
118
|
+
: outcome === LoginOutcome.Failed ? SurrogateStage.Failed
|
|
119
|
+
: SurrogateStage.Working, onAction: outcome === LoginOutcome.Gesture ? onLogin : () => window.close(), error: errorDescription ?? error ?? undefined, translate: (key, defaultValue) => tAuth(key, { defaultValue }) });
|
|
120
|
+
}
|
|
90
121
|
if (error != null) {
|
|
91
122
|
return _jsx("div", { children: t('error', { error: errorDescription ?? error }) });
|
|
92
123
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dispatcher.js","sourceRoot":"","sources":["../../src/components/dispatcher.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"dispatcher.js","sourceRoot":"","sources":["../../src/components/dispatcher.tsx"],"names":[],"mappings":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