@owlmeans/client-auth 0.1.18-rc.2 → 0.1.18-rc.21

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.
Files changed (170) hide show
  1. package/README.md +6 -6
  2. package/agent-meta/manifest.json +2 -2
  3. package/agent-meta/skills/client-auth/SKILL.md +134 -21
  4. package/build/components/dispatcher/component.js +1 -1
  5. package/build/components/dispatcher/component.js.map +1 -1
  6. package/build/{modules.d.ts → entrypoints.d.ts} +2 -2
  7. package/build/entrypoints.d.ts.map +1 -0
  8. package/build/{modules.js → entrypoints.js} +3 -3
  9. package/build/entrypoints.js.map +1 -0
  10. package/build/helper.js +1 -1
  11. package/build/helper.js.map +1 -1
  12. package/build/index.d.ts +1 -1
  13. package/build/index.d.ts.map +1 -1
  14. package/build/index.js +1 -1
  15. package/build/index.js.map +1 -1
  16. package/build/login/adopt.d.ts +24 -0
  17. package/build/login/adopt.d.ts.map +1 -0
  18. package/build/login/adopt.js +28 -0
  19. package/build/login/adopt.js.map +1 -0
  20. package/build/login/consts.d.ts +57 -0
  21. package/build/login/consts.d.ts.map +1 -0
  22. package/build/login/consts.js +57 -0
  23. package/build/login/consts.js.map +1 -0
  24. package/build/login/credit.d.ts +24 -0
  25. package/build/login/credit.d.ts.map +1 -0
  26. package/build/login/credit.js +58 -0
  27. package/build/login/credit.js.map +1 -0
  28. package/build/login/env.d.ts +32 -0
  29. package/build/login/env.d.ts.map +1 -0
  30. package/build/login/env.js +84 -0
  31. package/build/login/env.js.map +1 -0
  32. package/build/login/flow.d.ts +20 -0
  33. package/build/login/flow.d.ts.map +1 -0
  34. package/build/login/flow.js +39 -0
  35. package/build/login/flow.js.map +1 -0
  36. package/build/login/hook.d.ts +37 -0
  37. package/build/login/hook.d.ts.map +1 -0
  38. package/build/login/hook.js +72 -0
  39. package/build/login/hook.js.map +1 -0
  40. package/build/login/i18n/be.json +37 -0
  41. package/build/login/i18n/de.json +37 -0
  42. package/build/login/i18n/en.json +37 -0
  43. package/build/login/i18n/es.json +37 -0
  44. package/build/login/i18n/pl.json +37 -0
  45. package/build/login/i18n/ru.json +37 -0
  46. package/build/login/i18n/uk.json +37 -0
  47. package/build/login/i18n.d.ts +2 -0
  48. package/build/login/i18n.d.ts.map +1 -0
  49. package/build/login/i18n.js +25 -0
  50. package/build/login/i18n.js.map +1 -0
  51. package/build/login/index.d.ts +15 -0
  52. package/build/login/index.d.ts.map +1 -0
  53. package/build/login/index.js +15 -0
  54. package/build/login/index.js.map +1 -0
  55. package/build/login/methods.d.ts +25 -0
  56. package/build/login/methods.d.ts.map +1 -0
  57. package/build/login/methods.js +97 -0
  58. package/build/login/methods.js.map +1 -0
  59. package/build/login/resume.d.ts +30 -0
  60. package/build/login/resume.d.ts.map +1 -0
  61. package/build/login/resume.js +55 -0
  62. package/build/login/resume.js.map +1 -0
  63. package/build/login/screen.d.ts +17 -0
  64. package/build/login/screen.d.ts.map +1 -0
  65. package/build/login/screen.js +76 -0
  66. package/build/login/screen.js.map +1 -0
  67. package/build/login/service.d.ts +31 -0
  68. package/build/login/service.d.ts.map +1 -0
  69. package/build/login/service.js +137 -0
  70. package/build/login/service.js.map +1 -0
  71. package/build/login/surrogate.d.ts +20 -0
  72. package/build/login/surrogate.d.ts.map +1 -0
  73. package/build/login/surrogate.js +33 -0
  74. package/build/login/surrogate.js.map +1 -0
  75. package/build/login/terms.d.ts +20 -0
  76. package/build/login/terms.d.ts.map +1 -0
  77. package/build/login/terms.js +0 -0
  78. package/build/login/terms.js.map +1 -0
  79. package/build/login/types.d.ts +236 -0
  80. package/build/login/types.d.ts.map +1 -0
  81. package/build/login/types.js +23 -0
  82. package/build/login/types.js.map +1 -0
  83. package/build/manager/components/authentication/control.js +3 -3
  84. package/build/manager/components/authentication/control.js.map +1 -1
  85. package/build/manager/components/authentication/types.d.ts +2 -2
  86. package/build/manager/components/authentication/types.d.ts.map +1 -1
  87. package/build/manager/components/tunnel-consumer.js +2 -2
  88. package/build/manager/components/tunnel-consumer.js.map +1 -1
  89. package/build/manager/entrypoints.d.ts +2 -0
  90. package/build/manager/entrypoints.d.ts.map +1 -0
  91. package/build/manager/{modules.js → entrypoints.js} +4 -4
  92. package/build/manager/entrypoints.js.map +1 -0
  93. package/build/manager/plugins/basic-ed25519.d.ts.map +1 -1
  94. package/build/manager/plugins/basic-ed25519.js +5 -0
  95. package/build/manager/plugins/basic-ed25519.js.map +1 -1
  96. package/build/manager/plugins/exports.d.ts +2 -0
  97. package/build/manager/plugins/exports.d.ts.map +1 -1
  98. package/build/manager/plugins/exports.js +2 -0
  99. package/build/manager/plugins/exports.js.map +1 -1
  100. package/build/manager/plugins/index.d.ts +1 -5
  101. package/build/manager/plugins/index.d.ts.map +1 -1
  102. package/build/manager/plugins/index.js +9 -1
  103. package/build/manager/plugins/index.js.map +1 -1
  104. package/build/manager/plugins/methods.d.ts +6 -0
  105. package/build/manager/plugins/methods.d.ts.map +1 -0
  106. package/build/manager/plugins/methods.js +65 -0
  107. package/build/manager/plugins/methods.js.map +1 -0
  108. package/build/manager/plugins/re-captcha.d.ts.map +1 -1
  109. package/build/manager/plugins/re-captcha.js +5 -0
  110. package/build/manager/plugins/re-captcha.js.map +1 -1
  111. package/build/manager/plugins/registry.d.ts +20 -0
  112. package/build/manager/plugins/registry.d.ts.map +1 -0
  113. package/build/manager/plugins/registry.js +19 -0
  114. package/build/manager/plugins/registry.js.map +1 -0
  115. package/build/manager/plugins/tunnel-consumer.d.ts.map +1 -1
  116. package/build/manager/plugins/tunnel-consumer.js +4 -0
  117. package/build/manager/plugins/tunnel-consumer.js.map +1 -1
  118. package/build/manager/plugins/types.d.ts +53 -0
  119. package/build/manager/plugins/types.d.ts.map +1 -1
  120. package/build/service.js +1 -1
  121. package/build/service.js.map +1 -1
  122. package/package.json +36 -27
  123. package/src/components/dispatcher/component.tsx +1 -1
  124. package/src/{modules.ts → entrypoints.ts} +2 -2
  125. package/src/helper.ts +1 -1
  126. package/src/index.ts +1 -1
  127. package/src/login/adopt.ts +31 -0
  128. package/src/login/consts.ts +70 -0
  129. package/src/login/credit.ts +75 -0
  130. package/src/login/env.ts +86 -0
  131. package/src/login/flow.ts +44 -0
  132. package/src/login/hook.ts +80 -0
  133. package/src/login/i18n/be.json +37 -0
  134. package/src/login/i18n/de.json +37 -0
  135. package/src/login/i18n/en.json +37 -0
  136. package/src/login/i18n/es.json +37 -0
  137. package/src/login/i18n/pl.json +37 -0
  138. package/src/login/i18n/ru.json +37 -0
  139. package/src/login/i18n/uk.json +37 -0
  140. package/src/login/i18n.ts +26 -0
  141. package/src/login/index.ts +15 -0
  142. package/src/login/methods.ts +113 -0
  143. package/src/login/resume.ts +56 -0
  144. package/src/login/screen.tsx +136 -0
  145. package/src/login/service.ts +181 -0
  146. package/src/login/surrogate.ts +45 -0
  147. package/src/login/terms.ts +0 -0
  148. package/src/login/types.ts +258 -0
  149. package/src/manager/README.md +1 -1
  150. package/src/manager/components/authentication/control.ts +3 -3
  151. package/src/manager/components/authentication/types.ts +2 -2
  152. package/src/manager/components/tunnel-consumer.tsx +2 -2
  153. package/src/manager/{modules.ts → entrypoints.ts} +3 -3
  154. package/src/manager/plugins/basic-ed25519.tsx +7 -0
  155. package/src/manager/plugins/exports.ts +2 -0
  156. package/src/manager/plugins/index.ts +10 -4
  157. package/src/manager/plugins/methods.ts +74 -0
  158. package/src/manager/plugins/re-captcha.tsx +7 -0
  159. package/src/manager/plugins/registry.ts +26 -0
  160. package/src/manager/plugins/tunnel-consumer.tsx +6 -0
  161. package/src/manager/plugins/types.ts +54 -0
  162. package/src/service.ts +1 -1
  163. package/tests/context.ts +1 -2
  164. package/tests/login.spec.ts +313 -0
  165. package/build/.gitkeep +0 -0
  166. package/build/manager/modules.d.ts +0 -2
  167. package/build/manager/modules.d.ts.map +0 -1
  168. package/build/manager/modules.js.map +0 -1
  169. package/build/modules.d.ts.map +0 -1
  170. package/build/modules.js.map +0 -1
package/README.md CHANGED
@@ -6,13 +6,13 @@ Client-side authentication service providing user auth state and external auth f
6
6
 
7
7
  - `useSelfAuth()` — React hook that returns the current authenticated user's `Auth` object
8
8
  - `setupExternalAuthentication()` — configure the client to authenticate against an external identity provider
9
- - `modules` — pre-built client modules for the auth flow (login, dispatcher)
9
+ - `entrypoints` — pre-built client entrypoints for the auth flow (login, dispatcher)
10
10
  - `DEFAULT_ALIAS` — the auth service alias (`'auth'`)
11
11
 
12
12
  ## Installation
13
13
 
14
14
  ```bash
15
- bun add @owlmeans/client-auth
15
+ bun add @owlmeans/client-auth@^0.1.18-rc.19
16
16
  ```
17
17
 
18
18
  ## Usage
@@ -47,9 +47,9 @@ Returns the current `Auth` object from the context, or `null` if not authenticat
47
47
 
48
48
  Configures the context to redirect to an external identity provider for authentication.
49
49
 
50
- ### `modules`
50
+ ### `entrypoints`
51
51
 
52
- Pre-built `ClientModule[]` for the auth flow (mirrors `@owlmeans/auth-common`'s modules with client route models).
52
+ Pre-built `ClientEntrypoint[]` for the auth flow (mirrors `@owlmeans/auth-common`'s entrypoints with client route models).
53
53
 
54
54
  ### `DEFAULT_ALIAS`
55
55
 
@@ -65,7 +65,7 @@ Auth service alias: `'auth'`.
65
65
  ## Related Packages
66
66
 
67
67
  - [`@owlmeans/auth`](../auth) — `Auth` type returned by `useSelfAuth`
68
- - [`@owlmeans/auth-common`](../auth-common) — auth module route definitions
68
+ - [`@owlmeans/auth-common`](../auth-common) — auth entrypoint route definitions
69
69
  - [`@owlmeans/server-auth`](../server-auth) — server-side counterpart
70
70
 
71
71
  <!-- owlmeans:agent-guidance:start -->
@@ -76,7 +76,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
76
76
  your project's skill store (`.agents/skills/`):
77
77
 
78
78
  ```sh
79
- npx @owlmeans/agent-skills
79
+ npx @owlmeans/agent-skills@^0.1.18-rc.13
80
80
  ```
81
81
 
82
82
  The embedded files are version-matched to this package release. Do not edit them
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": 2,
3
3
  "package": "@owlmeans/client-auth",
4
- "version": "0.1.18-rc.0",
5
- "generatedAt": "2026-08-16T22:20:50.498Z",
4
+ "version": "0.1.18-rc.21",
5
+ "generatedAt": "2026-09-10T18:54:42.486Z",
6
6
  "canonicalRepo": "https://github.com/owlmeans/common",
7
7
  "entries": [
8
8
  {
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: client-auth
3
- description: How to use @owlmeans/client-auth — client-side auth manager and UI components, setupExternalAuthentication() to wire OAuth/OIDC flows. Auto-invoked when importing client-auth helpers or registering external authentication.
3
+ description: How to use @owlmeans/client-auth — the browser side of OwlMeans authentication. Root exports the auth service, the shared client entrypoints and the dispatcher HOC; ./manager holds the authentication screen, its control and the plugin registry; ./manager/plugins holds the authentication-plugin contract a plugin package writes against; ./login holds the login-plugin host, the sign-in method registry, the terms confirmation and the useLogin/useLogout hooks. Auto-invoked when importing client-auth helpers, registering an authentication plugin, or wiring a sign-in control.
4
4
  user-invocable: false
5
5
  ---
6
6
  <!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
@@ -8,41 +8,154 @@ user-invocable: false
8
8
  # @owlmeans/client-auth
9
9
 
10
10
  **Layer:** Client
11
- **Install:** `"@owlmeans/client-auth": "^0.1.18-rc.0"` in `dependencies`
11
+ **Install:** `"@owlmeans/client-auth": "^0.1.18-rc.21"` in `dependencies`
12
12
 
13
- ## Key Exports
13
+ Five subpaths, five jobs:
14
+
15
+ | Subpath | Job |
16
+ |---------|-----|
17
+ | `.` | The client `AuthService`, the shared auth entrypoints, and the dispatcher HOC |
18
+ | `./manager` | The registry's four names plus the authentication screen, control and error — *how* a user proves identity. Importing it registers the three shipped browser plugins and `pluginMethodSource` by side effect |
19
+ | `./manager/entrypoints` | The manager application's own front-end entrypoint elevations |
20
+ | `./manager/plugins` | The plugin-authoring surface, and a superset of the registry: the `AuthenticationPlugin` contract, `pluginMethodSource`, the wallet-tunnel helpers and the shipped plugin objects — with no registration side effect |
21
+ | `./login` | The **login**-plugin host — *where* the authorization round trip runs, and which method a person picks |
22
+
23
+ A plugin package imports from both, and the split is fixed: `AuthenticationPlugin`,
24
+ `AuthMethodMeta`, `pluginMethodSource`, `PinSchema`, `createWalletFacade`,
25
+ `TunnelAuthenticationRenderer` and the shipped plugin objects resolve **only** through
26
+ `./manager/plugins`; the registry (`plugins`, `registerAuthPlugin`, …) and the rendering types
27
+ (`AuthenticationRenderer`, `AuthenticationControl`, `ClientAuthType`, `AuthenticationHOC`) resolve
28
+ through `./manager`. Importing the contract from `./manager` gets an unresolvable name.
29
+
30
+ `./manager/plugins` and `./login` answer different questions and are separate registries. Do not
31
+ conflate them.
32
+
33
+ ## Key Exports — root
34
+
35
+ | Export | Description |
36
+ |--------|-------------|
37
+ | `makeAuthService(alias?)` | The client `AuthService` — `authenticate(token)`, `update(token)`, `authenticated()`, `user()`, `store()`. Decodes the bearer envelope and persists the record |
38
+ | `appendAuthService(ctx, alias?)` | Register it, register `authMiddleware`, and expose `context.auth()` |
39
+ | `setupExternalAuthentication(service)` | Point the `CAUTHEN_FLOW_ENTER` entrypoint at a service, so an external provider can redirect into this app |
40
+ | `entrypoints` | The shared auth entrypoint list with `DISPATCHER_AUTHEN` elevated |
41
+ | `DEFAULT_ALIAS` | `'auth'` — the client-side counterpart of `DEFAULT_GUARD` |
42
+ | `AUTH_RESOURCE` | `'auth'` — the resource the token record is stored in |
43
+ | `USER_ID` | `'user'` — the id of that single record |
44
+ | `DEFAULT_ENTITY` | `'owlmeans'` |
45
+ | `DispatcherHOC` | The return-leg HOC. It wraps a `DispatcherRenderer`, hands it `provideToken(token, query)` and `navigate()`, adopts the supplied token through the auth service, and strips `AUTH_QUERY` before navigating on. Reading the return-leg query is the renderer's job — `@owlmeans/web-client` reads `AUTH_QUERY`, `@owlmeans/web-oidc-rp` also reads `OIDC_ERROR_QUERY` and forwards the remaining params |
46
+ | `DispatcherProps`, `TDispatcherHOC`, `DispatcherRenderer`, `DispatcherRendererProps` | Dispatcher types |
47
+ | `useWs(entrypoint, request?)` | A socket hook that attaches the current token as the `AUTH_QUERY` param |
48
+ | `useSelfAuth(force?)` | Whether this context is authenticated; navigates to `DISPATCHER` when it is not and `force` |
49
+ | `AuthServiceAppend`, `ClientAuthRecord`, `ClientAuthResource` | Types |
50
+
51
+ ## `./manager` — the authentication screen and the registry
52
+
53
+ | Export | Description |
54
+ |--------|-------------|
55
+ | `plugins`, `registerAuthPlugin`, `getAuthPlugin`, `listAuthPlugins` | The module-global registry |
56
+ | `AuthenticationHOC`, `AuthenticationProps`, `TAuthenticationHOC` | The screen that hosts a plugin's implementation |
57
+ | `makeControl`, `AuthenticationControl`, `AuthenticationControlState` | The control a plugin drives: `requestAllowence`, `authenticate`, and the state it persists across a provider redirect |
58
+ | `AuthenticationRenderer`, `AuthenticationRendererProps`, `ClientAuthType`, `ClientAuthenticationMethod`, `AuthenticationCallback` | Rendering contract |
59
+ | `TunnelConsumer`, `TunnelAuthenticationProps`, `TunnelAuthCallback` | The wallet-tunnel consumer screen |
60
+ | `AuthenCredError` | Thrown when the entered credential cannot be used |
61
+
62
+ ## `./manager/plugins` — the authentication-plugin contract
14
63
 
15
64
  | Export | Description |
16
65
  |--------|-------------|
17
- | `setupExternalAuthentication(alias)` | Register OAuth/OIDC external auth flow module |
18
- | Auth components | Login UI primitives |
19
- | Auth service | Client-side auth manager service |
20
- | Modules | Auth module declarations |
21
- | Constants | Auth aliases (re-exports `AUTH_API`) |
66
+ | `AuthenticationPlugin` | `type`, `Implementation`, optional `Renderer`, `requiresRenderer?`, `method?` and the `authenticate` / `beforeAuthenticate` / `afterAuthenticate` hooks |
67
+ | `PluginImplemnetation` (sic) | `(Renderer?) => FC<AuthenticationRendererProps>` — the shape of `Implementation` |
68
+ | `AuthMethodMeta` | How the plugin presents itself as a sign-in method — see `login-methods` |
69
+ | `plugins`, `registerAuthPlugin`, `getAuthPlugin`, `listAuthPlugins` | The same registry as `./manager` |
70
+ | `pluginMethodSource` | The `LoginMethodSource` that turns registered plugins into offerable methods |
71
+ | `createWalletFacade`, `PinSchema`, `PinForm`, `TunnelAuthenticationRenderer`, `TunnelAuthenticationRendererProps` | Wallet-tunnel helpers a consumer plugin builds on |
72
+ | `ed25519BasicUIPlugin`, `reCaptchaPlugin`, `tunnelConsumerUIPlugin` | The shipped plugin objects |
22
73
 
23
- ## Subpath Exports
74
+ Shipped plugins register themselves by side effect: `basic-ed25519`, `re-captcha` and
75
+ `wallet-consumer` when `@owlmeans/client-auth/manager` is imported, OIDC and Google from
76
+ `@owlmeans/web-oidc-rp/auth/plugins`, the PK supervisor from `@owlmeans/web-auth`.
24
77
 
25
- - `./manager` — client-side auth manager
26
- - `./manager/modules` — manager module declarations
27
- - `./manager/plugins` — pluggable token providers
78
+ ## `./login` — the login-plugin host
79
+
80
+ An `AuthenticationPlugin` answers how a credential is proven; a `LoginPlugin` answers in which
81
+ browsing context the round trip can complete at all.
82
+
83
+ | Export | Description |
84
+ |--------|-------------|
85
+ | `appendLogin(ctx)` | Register the host and expose it as `context.login()` |
86
+ | `makeLoginService(alias?)`, `ensureLoginService(ctx)` | The host itself — a **lazy** service, so `makeContext` can reach it at the Loading stage — and the idempotent getter a plugin package calls before `registerPlugin` |
87
+ | `LoginPlugin`, `LoginEnv`, `LoginRequest`, `LogoutRequest`, `LoginOutcome`, `LoginIntent`, `LoginService`, `LoginContext`, `LoginPrecondition` | The contract |
88
+ | `registerMethodSource`, `listMethodSources`, `resolveLoginMethods`, `primaryLoginMethod` | Which sign-in methods are offered — see `login-methods` |
89
+ | `LoginMethod`, `LoginMethodSource`, `LoginMethodContext` | Method types |
90
+ | `resolveTerms`, `termsAccepted`, `acceptTerms`, `ResolvedTerms` | The confirmation, recorded in `localStorage` against a version derived from the resolved URLs |
91
+ | `resolveCredit`, `ResolvedCredit` | The credit and copyright line |
92
+ | `FallbackLoginScreen`, `LoginScreenProps`, `LoginScreenComponent` | The plain sign-in screen a relying party renders when no UI family registered one |
93
+ | `surrogatePath(ctx, target)`, `SurrogateTarget` | Where a surrogate login window opens; `null` on an older entrypoint list |
94
+ | `resumeAction(outcome)`, `ResumeAction`, `loginAttemptError(outcome)` | The one reading of a `resume` outcome, and the one reading of a finished attempt |
95
+ | `enterOidcAuthorization(model)` | Move a flow to the step that can authorize — idempotent, call it before every `authenticate` |
96
+ | `adoptToken(ctx, token)`, `revokeToken(ctx)` | The single adoption and de-adoption paths |
97
+ | `useLogin(target?)`, `useLogout(target?)` | Wiring for a sign-in / sign-out control; `target` is the entrypoint alias the flow lands on when it is over |
98
+ | `isEmbedded`, `isSurrogate`, `markSurrogate`, `clearSurrogate`, `defaultLoginEnv` | Environment probes the host builds `LoginEnv` from |
99
+ | `LOGIN_SERVICE`, `LOGIN_SURROGATE_NAME`, `LOGIN_TOKEN_MESSAGE`, `LOGIN_LOGOUT_MESSAGE`, `LOGIN_SURROGATE_MARKER`, `LOGIN_SURROGATE_FEATURES`, `LOGIN_WATCH_INTERVAL`, `LOGIN_INTENT_QUERY`, `LOGIN_NEXT_QUERY`, `LOGIN_METHOD_QUERY`, `LOGIN_TERMS_STORAGE`, `DEFAULT_LOGIN_PRIORITY`, `DEFAULT_METHOD_ORDER` | Aliases and the fixed cross-document wire values |
100
+
101
+ ```typescript
102
+ import { useLogin, useLogout } from '@owlmeans/client-auth/login'
103
+
104
+ const [loginPath, onLogIn] = useLogin()
105
+ const onLogOut = useLogout()
106
+ ```
107
+
108
+ Both handlers are deliberately **not** async and await nothing before delegating — a window opened
109
+ after the user gesture has finished being handled is eaten by the popup blocker. Each resolves its
110
+ entrypoint **inside** the hook, never at module scope — `DISPATCHER` for `useLogin`, the surrogate
111
+ path for `useLogout`. A module body runs before `registerEntrypoints`, so `useLogin`'s lookup at
112
+ top level throws `Entrypoint dispatcher not found` during import, taking the whole render down.
113
+
114
+ `target` is an entrypoint alias, and it is what supplies the request's `navigate` continuation —
115
+ the in-app step the plugin runs once the round trip is done. `useLogin` always sends one, falling
116
+ back to `DISPATCHER`; `useLogout` sends one only when a target is given. Omitting it does not leave
117
+ the session behind: the token is revoked either way, and the plugin decides what the document does
118
+ with no continuation to run — `@owlmeans/web-client`'s redirect plugin reloads the page, because
119
+ cached auth reads only forget a session when the application is rebuilt. `useLogin` returns
120
+ `[path, handler]` and `useLogout` a bare handler — a logout control has no address to point at.
121
+
122
+ Plugin selection, the shipped browser flows and the full invariant list: the `login-plugins` skill.
28
123
 
29
124
  ## Usage
30
125
 
31
126
  ```typescript
32
- import { setupExternalAuthentication } from '@owlmeans/client-auth'
127
+ import { appendAuthService, setupExternalAuthentication, DEFAULT_ALIAS } from '@owlmeans/client-auth'
128
+ import { appendLogin } from '@owlmeans/client-auth/login'
33
129
 
34
- setupExternalAuthentication(AUTH_WEB) // alias of the web auth service
130
+ // in makeContext:
131
+ appendAuthService(context) // registers under DEFAULT_ALIAS ('auth')
132
+ appendLogin(context)
133
+ setupExternalAuthentication(MY_WEB_SERVICE) // the service alias the provider redirects into
35
134
  ```
36
135
 
37
- ## Product-Viable Usage Notes
136
+ `@owlmeans/web-client`'s own `makeContext` already appends the auth service and the login host, so
137
+ a web application only calls these when it builds its context by hand.
138
+
139
+ ## Rules
38
140
 
39
- - The manager web app imports `DEFAULT_ALIAS` from `@owlmeans/client-auth` as the client-side equivalent of `DEFAULT_GUARD`.
40
- - It imports `@owlmeans/web-oidc-rp/auth/plugins` for side effects; that registers OIDC and Google authentication plugins in the client auth manager.
41
- - During Google/OIDC redirects, plugins persist the client auth control state, restore it on return, then submit `AuthCredentials` to the server auth flow.
42
- - The browser receives and stores a normal OwlMeans bearer token. Product authorization remains server-side through module gates and handler checks, not through client-only state.
141
+ - The bearer token lives in the `AUTH_RESOURCE` resource under the single id `USER_ID`. Read and
142
+ write it through the auth service or through `adoptToken` / `revokeToken`; hand-written storage
143
+ access drifts from the envelope decoding that happens beside it.
144
+ - A plugin that persists state across a provider redirect drives the control's own
145
+ `persist()` / `restore()` / `hasPersistentState()` / `cleanUpState()`. They keep the type, stage
146
+ and allowance in the `FLOW_STATE` resource under an id this package owns and does not export —
147
+ restore before submitting the credential, and clean up after.
148
+ - The browser ends up holding an ordinary OwlMeans bearer token whichever provider issued the
149
+ login. Product authorization stays server-side, in entrypoint gates and handler checks — never in
150
+ client-only state.
151
+ - The organization entity a token names is its `entitySlug`, the renameable public name. Read it
152
+ with `entitySlugOf` from `@owlmeans/auth`; the stable `entityId` never reaches the browser.
43
153
 
44
154
  ## Depends On
45
155
 
46
- - `@owlmeans/auth`, `@owlmeans/auth-common`
47
- - `@owlmeans/client-context`, `@owlmeans/client-entrypoint`
156
+ - `@owlmeans/auth`, `@owlmeans/auth-common` — types, aliases, `authMiddleware`
157
+ - `@owlmeans/client`, `@owlmeans/client-context`, `@owlmeans/client-entrypoint`, `@owlmeans/client-socket`
158
+ - `@owlmeans/config` — the login screen, terms and credit configuration
159
+ - `@owlmeans/basic-envelope` — decoding the bearer envelope
48
160
  - `react` (peer)
161
+ - `ajv` (peer) — `PinSchema` is typed as `JSONSchemaType<PinForm>`
@@ -12,7 +12,7 @@ export const DispatcherHOC = Renderer => ({ context, params, alias, query, paylo
12
12
  const navigator = useNavigate();
13
13
  const navigate = useCallback(async () => {
14
14
  alias = alias == null || alias === DISPATCHER ? HOME : alias;
15
- const module = context.module(alias);
15
+ const module = context.entrypoint(alias);
16
16
  if (alias === HOME) {
17
17
  params = {};
18
18
  query = {};
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sourceRoot":"","sources":["../../../src/components/dispatcher/component.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAGxD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAEvD,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AACxC,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAE/D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAG9C,OAAO,EAAE,aAAa,IAA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,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;QACzF,aAAa,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAA;IACjC,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,OAAO,KAAC,QAAQ,IAAC,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,GAAI,CAAA;AACrE,CAAC,CAAA"}
@@ -1,4 +1,4 @@
1
1
  import type { ClientEntrypoint } from '@owlmeans/client-entrypoint';
2
- export declare const modules: ClientEntrypoint[];
2
+ export declare const entrypoints: ClientEntrypoint[];
3
3
  export declare const setupExternalAuthentication: (service: string) => void;
4
- //# sourceMappingURL=modules.d.ts.map
4
+ //# sourceMappingURL=entrypoints.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entrypoints.d.ts","sourceRoot":"","sources":["../src/entrypoints.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAInE,eAAO,MAAM,WAAW,EAAE,gBAAgB,EAA+B,CAAA;AAEzE,eAAO,MAAM,2BAA2B,YAAa,MAAM,SAE1D,CAAA"}
@@ -1,9 +1,9 @@
1
1
  import { elevate, stab } from '@owlmeans/client-entrypoint';
2
- import { modules as list } from '@owlmeans/auth-common';
2
+ import { entrypoints as list } from '@owlmeans/auth-common';
3
3
  import { CAUTHEN_FLOW_ENTER, DISPATCHER_AUTHEN } from '@owlmeans/auth';
4
4
  elevate(list, DISPATCHER_AUTHEN);
5
- export const modules = list;
5
+ export const entrypoints = list;
6
6
  export const setupExternalAuthentication = (service) => {
7
7
  elevate(list, CAUTHEN_FLOW_ENTER, stab, { routeOptions: { overrides: { service } } });
8
8
  };
9
- //# sourceMappingURL=modules.js.map
9
+ //# sourceMappingURL=entrypoints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entrypoints.js","sourceRoot":"","sources":["../src/entrypoints.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAA;AAC3D,OAAO,EAAE,WAAW,IAAI,IAAI,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAGtE,OAAO,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAA;AAEhC,MAAM,CAAC,MAAM,WAAW,GAAuB,IAA0B,CAAA;AAEzE,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,OAAe,EAAE,EAAE;IAC7D,OAAO,CAAC,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE,EAAE,YAAY,EAAE,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAA;AACvF,CAAC,CAAA"}
package/build/helper.js CHANGED
@@ -11,7 +11,7 @@ export const useWs = (module, _request) => {
11
11
  const mod = useMemo(() => typeof module === 'string' ? ctx.entrypoint(module) : module, [module]);
12
12
  const request = useMemo(() => {
13
13
  if (_request == null) {
14
- _request = provideRequest(mod.getAlias(), mod.getPath());
14
+ _request = provideRequest(mod.alias, mod.path());
15
15
  }
16
16
  try {
17
17
  if (_request?.query?.[AUTH_QUERY] == null) {
@@ -1 +1 @@
1
- {"version":3,"file":"helper.js","sourceRoot":"","sources":["../src/helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE1D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,EAAE,KAAK,IAAI,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAG/D,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEpD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AACvD,+CAA+C;AAC/C,+CAA+C;AAC/C,gDAAgD;AAEhD,MAAM,CAAC,MAAM,KAAK,G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AI,EAAE,CAAC;gBACnB,GAAG,CAAC,EAAE,CAAC,UAAU,CAAC,CAAA;gBAClB,6BAA6B;gBAC7B,qEAAqE;YACvE,CAAC;YAED,gBAAgB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;QAC1B,CAAC,CAAC,CAAA;IACJ,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,OAAO,aAAa,CAAA;AACtB,CAAC,CAAA"}
package/build/index.d.ts CHANGED
@@ -2,6 +2,6 @@ export * from './components/index.js';
2
2
  export type * from './types.js';
3
3
  export * from './service.js';
4
4
  export * from './consts.js';
5
- export * from './modules.js';
5
+ export * from './entrypoints.js';
6
6
  export * from './helper.js';
7
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,uBAAuB,CAAA;AACrC,mBAAmB,YAAY,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,uBAAuB,CAAA;AACrC,mBAAmB,YAAY,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA;AAChC,cAAc,aAAa,CAAA"}
package/build/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export * from './components/index.js';
2
2
  export * from './service.js';
3
3
  export * from './consts.js';
4
- export * from './modules.js';
4
+ export * from './entrypoints.js';
5
5
  export * from './helper.js';
6
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,uBAAuB,CAAA;AAErC,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,uBAAuB,CAAA;AAErC,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA;AAChC,cAAc,aAAa,CAAA"}
@@ -0,0 +1,24 @@
1
+ import type { LoginContext } from './types.js';
2
+ /**
3
+ * The one path an issued bearer token becomes this context's authentication.
4
+ *
5
+ * Resolved by alias rather than through `ctx.auth()` so the login host does not require
6
+ * `AuthServiceAppend` on the context it is given — a plugin can adopt a token on any context that
7
+ * carries the auth service, including one it did not build.
8
+ *
9
+ * Going through `AuthService.update` matters: it stores the record, decodes the envelope and sets
10
+ * both `auth` and `token` in one place. Writing those three by hand — which is what the popup and
11
+ * the MUI relying party each used to do — leaves the same state on a good day and diverges the
12
+ * moment any of it changes.
13
+ */
14
+ export declare const adoptToken: (ctx: LoginContext, token: string) => Promise<void>;
15
+ /**
16
+ * The one path this context's authentication is dropped, and the exact mirror of {@link adoptToken}.
17
+ *
18
+ * `undefined`, not `null`: `undefined` is the declared clearing value, and on the web the auth
19
+ * service reacts to it by navigating to the dispatcher. Everything that signs a user out goes
20
+ * through here — the hook, both browser plugins and the surrogate screen — so there is one place
21
+ * where "signed out" is defined rather than four that agree until one of them changes.
22
+ */
23
+ export declare const revokeToken: (ctx: LoginContext) => Promise<void>;
24
+ //# sourceMappingURL=adopt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adopt.d.ts","sourceRoot":"","sources":["../../src/login/adopt.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE9C;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,UAAU,QAAe,YAAY,SAAS,MAAM,KAAG,OAAO,CAAC,IAAI,CAE/E,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,QAAe,YAAY,KAAG,OAAO,CAAC,IAAI,CAEjE,CAAA"}
@@ -0,0 +1,28 @@
1
+ import { DEFAULT_ALIAS as AUTH_ALIAS } from '../consts.js';
2
+ /**
3
+ * The one path an issued bearer token becomes this context's authentication.
4
+ *
5
+ * Resolved by alias rather than through `ctx.auth()` so the login host does not require
6
+ * `AuthServiceAppend` on the context it is given — a plugin can adopt a token on any context that
7
+ * carries the auth service, including one it did not build.
8
+ *
9
+ * Going through `AuthService.update` matters: it stores the record, decodes the envelope and sets
10
+ * both `auth` and `token` in one place. Writing those three by hand — which is what the popup and
11
+ * the MUI relying party each used to do — leaves the same state on a good day and diverges the
12
+ * moment any of it changes.
13
+ */
14
+ export const adoptToken = async (ctx, token) => {
15
+ await ctx.service(AUTH_ALIAS).update(token);
16
+ };
17
+ /**
18
+ * The one path this context's authentication is dropped, and the exact mirror of {@link adoptToken}.
19
+ *
20
+ * `undefined`, not `null`: `undefined` is the declared clearing value, and on the web the auth
21
+ * service reacts to it by navigating to the dispatcher. Everything that signs a user out goes
22
+ * through here — the hook, both browser plugins and the surrogate screen — so there is one place
23
+ * where "signed out" is defined rather than four that agree until one of them changes.
24
+ */
25
+ export const revokeToken = async (ctx) => {
26
+ await ctx.service(AUTH_ALIAS).update(undefined);
27
+ };
28
+ //# sourceMappingURL=adopt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adopt.js","sourceRoot":"","sources":["../../src/login/adopt.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,IAAI,UAAU,EAAE,MAAM,cAAc,CAAA;AAG1D;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,EAAE,GAAiB,EAAE,KAAa,EAAiB,EAAE;IAClF,MAAM,GAAG,CAAC,OAAO,CAAc,UAAU,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AAC1D,CAAC,CAAA;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,EAAE,GAAiB,EAAiB,EAAE;IACpE,MAAM,GAAG,CAAC,OAAO,CAAc,UAAU,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;AAC9D,CAAC,CAAA"}
@@ -0,0 +1,57 @@
1
+ export declare const DEFAULT_ALIAS = "login-service";
2
+ export declare const LOGIN_SERVICE = "login-service";
3
+ /** Priority of a plugin that makes no claim about the environment. */
4
+ export declare const DEFAULT_LOGIN_PRIORITY = 0;
5
+ /** Order given to a method that declares none. */
6
+ export declare const DEFAULT_METHOD_ORDER = 100;
7
+ /**
8
+ * Name given to the surrogate login window, the marker it records about itself, and the values the
9
+ * two documents exchange.
10
+ *
11
+ * These are a wire protocol between two documents that may be running different builds — an opener
12
+ * holding an older bundle and a surrogate freshly loaded, or the reverse. They are therefore fixed,
13
+ * and must never be "tidied" to match a newer vocabulary. That applies to the query names and the
14
+ * message types added later just as much as to the original three.
15
+ */
16
+ export declare const LOGIN_SURROGATE_NAME = "owlmeans-oidc-login";
17
+ export declare const LOGIN_TOKEN_MESSAGE = "owlmeans:oidc:popup-token";
18
+ export declare const LOGIN_LOGOUT_MESSAGE = "owlmeans:oidc:popup-logout";
19
+ export declare const LOGIN_SURROGATE_MARKER = "_owlmeans-oidc-popup";
20
+ export declare const LOGIN_SURROGATE_FEATURES = "popup=yes,width=520,height=760";
21
+ /** How often a surrogate window is checked for having been closed by the user. */
22
+ export declare const LOGIN_WATCH_INTERVAL = 500;
23
+ /** Carries WHY the surrogate window was opened across the window boundary. */
24
+ export declare const LOGIN_INTENT_QUERY = "intent";
25
+ /**
26
+ * Carries the address the surrogate should run, so the flow parameters the opener's URL held are
27
+ * forwarded rather than discarded.
28
+ */
29
+ export declare const LOGIN_NEXT_QUERY = "next";
30
+ /**
31
+ * Carries the method the user already chose, one window up.
32
+ *
33
+ * A surrogate acting on it is not an auto-redirect in the "never choose for the user" sense: the
34
+ * choice was made, by a person, in the document that opened this one.
35
+ */
36
+ export declare const LOGIN_METHOD_QUERY = "method";
37
+ /**
38
+ * Says that this window was opened to PRODUCE a session, not to find one.
39
+ *
40
+ * A surrogate window runs on the application's own origin, so it can see a session the application
41
+ * left there earlier — and a session that is merely present is not a session that still works. The
42
+ * document holding it has no way to tell: `authenticated()` reads storage and decodes an envelope,
43
+ * and nothing in the client asks the server whether the record behind it is still there. So a
44
+ * revoked, replaced or expired token was handed straight back to the window that asked for a
45
+ * login, which adopted it, failed every call it made with it, and asked again — the same dead
46
+ * token, every time, for as long as the browser kept it. Clearing site data was the only exit,
47
+ * which is exactly how the defect was reported.
48
+ *
49
+ * With this set, the surrogate and the dispatcher both skip the resume and run the authorization
50
+ * flow. That is not the expensive path it sounds like: the provider's own session normally answers
51
+ * the request without asking the person anything, and what comes back is a token the provider has
52
+ * just vouched for. It is also what makes signing in as somebody else possible at all.
53
+ */
54
+ export declare const LOGIN_FRESH_QUERY = "fresh";
55
+ /** Where a browser records that it agreed to one exact set of legal documents. */
56
+ export declare const LOGIN_TERMS_STORAGE = "_owlmeans-login-terms";
57
+ //# sourceMappingURL=consts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../src/login/consts.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,kBAAkB,CAAA;AAE5C,eAAO,MAAM,aAAa,kBAAgB,CAAA;AAE1C,sEAAsE;AACtE,eAAO,MAAM,sBAAsB,IAAI,CAAA;AAEvC,kDAAkD;AAClD,eAAO,MAAM,oBAAoB,MAAM,CAAA;AAEvC;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,wBAAwB,CAAA;AAEzD,eAAO,MAAM,mBAAmB,8BAA8B,CAAA;AAE9D,eAAO,MAAM,oBAAoB,+BAA+B,CAAA;AAEhE,eAAO,MAAM,sBAAsB,yBAAyB,CAAA;AAE5D,eAAO,MAAM,wBAAwB,mCAAmC,CAAA;AAExE,kFAAkF;AAClF,eAAO,MAAM,oBAAoB,MAAM,CAAA;AAEvC,8EAA8E;AAC9E,eAAO,MAAM,kBAAkB,WAAW,CAAA;AAE1C;;;GAGG;AACH,eAAO,MAAM,gBAAgB,SAAS,CAAA;AAEtC;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,WAAW,CAAA;AAE1C;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,iBAAiB,UAAU,CAAA;AAExC,kFAAkF;AAClF,eAAO,MAAM,mBAAmB,0BAA0B,CAAA"}
@@ -0,0 +1,57 @@
1
+ export const DEFAULT_ALIAS = 'login-service';
2
+ export const LOGIN_SERVICE = DEFAULT_ALIAS;
3
+ /** Priority of a plugin that makes no claim about the environment. */
4
+ export const DEFAULT_LOGIN_PRIORITY = 0;
5
+ /** Order given to a method that declares none. */
6
+ export const DEFAULT_METHOD_ORDER = 100;
7
+ /**
8
+ * Name given to the surrogate login window, the marker it records about itself, and the values the
9
+ * two documents exchange.
10
+ *
11
+ * These are a wire protocol between two documents that may be running different builds — an opener
12
+ * holding an older bundle and a surrogate freshly loaded, or the reverse. They are therefore fixed,
13
+ * and must never be "tidied" to match a newer vocabulary. That applies to the query names and the
14
+ * message types added later just as much as to the original three.
15
+ */
16
+ export const LOGIN_SURROGATE_NAME = 'owlmeans-oidc-login';
17
+ export const LOGIN_TOKEN_MESSAGE = 'owlmeans:oidc:popup-token';
18
+ export const LOGIN_LOGOUT_MESSAGE = 'owlmeans:oidc:popup-logout';
19
+ export const LOGIN_SURROGATE_MARKER = '_owlmeans-oidc-popup';
20
+ export const LOGIN_SURROGATE_FEATURES = 'popup=yes,width=520,height=760';
21
+ /** How often a surrogate window is checked for having been closed by the user. */
22
+ export const LOGIN_WATCH_INTERVAL = 500;
23
+ /** Carries WHY the surrogate window was opened across the window boundary. */
24
+ export const LOGIN_INTENT_QUERY = 'intent';
25
+ /**
26
+ * Carries the address the surrogate should run, so the flow parameters the opener's URL held are
27
+ * forwarded rather than discarded.
28
+ */
29
+ export const LOGIN_NEXT_QUERY = 'next';
30
+ /**
31
+ * Carries the method the user already chose, one window up.
32
+ *
33
+ * A surrogate acting on it is not an auto-redirect in the "never choose for the user" sense: the
34
+ * choice was made, by a person, in the document that opened this one.
35
+ */
36
+ export const LOGIN_METHOD_QUERY = 'method';
37
+ /**
38
+ * Says that this window was opened to PRODUCE a session, not to find one.
39
+ *
40
+ * A surrogate window runs on the application's own origin, so it can see a session the application
41
+ * left there earlier — and a session that is merely present is not a session that still works. The
42
+ * document holding it has no way to tell: `authenticated()` reads storage and decodes an envelope,
43
+ * and nothing in the client asks the server whether the record behind it is still there. So a
44
+ * revoked, replaced or expired token was handed straight back to the window that asked for a
45
+ * login, which adopted it, failed every call it made with it, and asked again — the same dead
46
+ * token, every time, for as long as the browser kept it. Clearing site data was the only exit,
47
+ * which is exactly how the defect was reported.
48
+ *
49
+ * With this set, the surrogate and the dispatcher both skip the resume and run the authorization
50
+ * flow. That is not the expensive path it sounds like: the provider's own session normally answers
51
+ * the request without asking the person anything, and what comes back is a token the provider has
52
+ * just vouched for. It is also what makes signing in as somebody else possible at all.
53
+ */
54
+ export const LOGIN_FRESH_QUERY = 'fresh';
55
+ /** Where a browser records that it agreed to one exact set of legal documents. */
56
+ export const LOGIN_TERMS_STORAGE = '_owlmeans-login-terms';
57
+ //# sourceMappingURL=consts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consts.js","sourceRoot":"","sources":["../../src/login/consts.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAG,eAAe,CAAA;AAE5C,MAAM,CAAC,MAAM,aAAa,GAAG,aAAa,CAAA;AAE1C,sEAAsE;AACtE,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAA;AAEvC,kDAAkD;AAClD,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,CAAA;AAEvC;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,qBAAqB,CAAA;AAEzD,MAAM,CAAC,MAAM,mBAAmB,GAAG,2BAA2B,CAAA;AAE9D,MAAM,CAAC,MAAM,oBAAoB,GAAG,4BAA4B,CAAA;AAEhE,MAAM,CAAC,MAAM,sBAAsB,GAAG,sBAAsB,CAAA;AAE5D,MAAM,CAAC,MAAM,wBAAwB,GAAG,gCAAgC,CAAA;AAExE,kFAAkF;AAClF,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,CAAA;AAEvC,8EAA8E;AAC9E,MAAM,CAAC,MAAM,kBAAkB,GAAG,QAAQ,CAAA;AAE1C;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAA;AAEtC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,QAAQ,CAAA;AAE1C;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,OAAO,CAAA;AAExC,kFAAkF;AAClF,MAAM,CAAC,MAAM,mBAAmB,GAAG,uBAAuB,CAAA"}
@@ -0,0 +1,24 @@
1
+ import type { BrandSettings, LoginCreditConfig } from '@owlmeans/config';
2
+ export interface ResolvedCredit {
3
+ /** Whether "Powered by OwlMeans" is rendered. */
4
+ poweredBy: boolean;
5
+ /** The product and organization line, already composed. Null when there is nothing to say. */
6
+ line: string | null;
7
+ }
8
+ /**
9
+ * What the bottom of the sign-in screen says.
10
+ *
11
+ * It is a copyright notice, so it is composed as one: `© <year> <holder>`. That is the whole
12
+ * reason `copyright` defaults to on — the name on its own reads as a caption, and an application
13
+ * that means to assert a copyright would have had to write the mark and the year into a literal
14
+ * `line` to get one.
15
+ *
16
+ * The organization falls back to its slug because an organization record carries no readable name
17
+ * — so "no name" is the ordinary case, not an error, and a screen that rendered an empty line for
18
+ * it would be worse than one that renders the slug.
19
+ *
20
+ * `line` replaces everything when an app supplies it: a product with its own legal wording should
21
+ * not have to defeat a composition rule to use it.
22
+ */
23
+ export declare const resolveCredit: (cfg?: LoginCreditConfig, brand?: BrandSettings, service?: string) => ResolvedCredit;
24
+ //# sourceMappingURL=credit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credit.d.ts","sourceRoot":"","sources":["../../src/login/credit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAExE,MAAM,WAAW,cAAc;IAC7B,iDAAiD;IACjD,SAAS,EAAE,OAAO,CAAA;IAClB,8FAA8F;IAC9F,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;CACpB;AAuBD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,aAAa,SAClB,iBAAiB,UAAU,aAAa,YAAY,MAAM,KAC/D,cA2BF,CAAA"}