@owlmeans/client-auth 0.1.18-rc.43 → 0.1.18-rc.44
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 +2 -2
- package/agent-meta/manifest.json +2 -2
- package/agent-meta/skills/client-auth/SKILL.md +7 -10
- package/build/components/dispatcher/component.d.ts.map +1 -1
- package/build/components/dispatcher/component.js +12 -19
- package/build/components/dispatcher/component.js.map +1 -1
- package/build/login/i18n/be.json +2 -6
- package/build/login/i18n/de.json +2 -6
- package/build/login/i18n/en.json +2 -6
- package/build/login/i18n/es.json +2 -6
- package/build/login/i18n/fr.json +2 -6
- package/build/login/i18n/pl.json +2 -6
- package/build/login/i18n/ru.json +2 -6
- package/build/login/i18n/uk.json +2 -6
- package/build/login/index.d.ts +0 -2
- package/build/login/index.d.ts.map +1 -1
- package/build/login/index.js +0 -2
- package/build/login/index.js.map +1 -1
- package/build/login/screen.d.ts.map +1 -1
- package/build/login/screen.js +2 -27
- package/build/login/screen.js.map +1 -1
- package/build/login/service.d.ts.map +1 -1
- package/build/login/service.js +0 -20
- package/build/login/service.js.map +1 -1
- package/build/login/terms.d.ts +0 -38
- package/build/login/terms.d.ts.map +1 -1
- package/build/login/terms.js +0 -0
- package/build/login/terms.js.map +1 -1
- package/build/login/types.d.ts +0 -77
- package/build/login/types.d.ts.map +1 -1
- package/package.json +22 -22
- package/src/components/dispatcher/component.tsx +12 -25
- package/src/login/i18n/be.json +2 -6
- package/src/login/i18n/de.json +2 -6
- package/src/login/i18n/en.json +2 -6
- package/src/login/i18n/es.json +2 -6
- package/src/login/i18n/fr.json +2 -6
- package/src/login/i18n/pl.json +2 -6
- package/src/login/i18n/ru.json +2 -6
- package/src/login/i18n/uk.json +2 -6
- package/src/login/index.ts +0 -2
- package/src/login/screen.tsx +14 -58
- package/src/login/service.ts +2 -26
- package/src/login/terms.ts +0 -0
- package/src/login/types.ts +0 -82
- package/src/manager/README.md +1 -1
- package/build/login/land.d.ts +0 -44
- package/build/login/land.d.ts.map +0 -1
- package/build/login/land.js +0 -158
- package/build/login/land.js.map +0 -1
- package/build/login/terms-config.d.ts +0 -59
- package/build/login/terms-config.d.ts.map +0 -1
- package/build/login/terms-config.js +0 -2
- package/build/login/terms-config.js.map +0 -1
- package/src/login/land.ts +0 -186
- package/src/login/terms-config.ts +0 -49
- package/tests/i18n.spec.ts +0 -68
- package/tests/land.spec.ts +0 -241
- package/tests/terms.spec.ts +0 -202
package/build/login/terms.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"terms.js","sourceRoot":"","sources":["../../src/login/terms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAEjG,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"terms.js","sourceRoot":"","sources":["../../src/login/terms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAEjG,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAUjD;;;;;;GAMG;AACH,MAAM,MAAM,GAAG,CAAC,KAAe,EAAU,EAAE;IACzC,IAAI,IAAI,GAAG,CAAC,CAAA;IACZ,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QACnC,IAAI,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;IACtD,CAAC;IAED,OAAO,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;AAClC,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,GAA8B,EAAwB,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AY,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAA;QACrD,CAAC;IACH,CAAC;IAAC,MAAM,CAAC,CAAC,wDAAwD,CAAC,CAAC;AACtE,CAAC,CAAA"}
|
package/build/login/types.d.ts
CHANGED
|
@@ -189,13 +189,6 @@ export interface LoginScreenProps {
|
|
|
189
189
|
* reaches for an i18n provider crashes the whole render in an app mounted without one.
|
|
190
190
|
*/
|
|
191
191
|
translate?: (key: string, defaultValue: string) => string;
|
|
192
|
-
/**
|
|
193
|
-
* The current language, for `Intl.ListFormat` and a custom document's own locale-keyed label.
|
|
194
|
-
*
|
|
195
|
-
* A prop for the same reason `translate` is: a component that reaches for an i18n context
|
|
196
|
-
* directly crashes the whole render in an app mounted without one.
|
|
197
|
-
*/
|
|
198
|
-
locale?: string;
|
|
199
192
|
/** Replace or reorder what the resolver produced. */
|
|
200
193
|
methods?: LoginMethod[] | ((methods: LoginMethod[]) => LoginMethod[]);
|
|
201
194
|
terms?: LoginTermsConfig | false;
|
|
@@ -245,14 +238,6 @@ export interface LoginService extends LazyService {
|
|
|
245
238
|
screen: () => LoginScreenComponent | null;
|
|
246
239
|
/** See {@link LoginNotifier}. Replaces any previously registered notifier. */
|
|
247
240
|
registerNotifier: (notifier: LoginNotifier) => void;
|
|
248
|
-
/** Register a post-login step. Replace-by-alias, priority-sorted (higher first). */
|
|
249
|
-
registerStep: (step: LoginStep) => void;
|
|
250
|
-
/** Every registered step, priority-sorted (higher first). */
|
|
251
|
-
steps: () => LoginStep[];
|
|
252
|
-
/** Register a hook that observes a freshly authenticated token. Replace-by-alias, priority-sorted. */
|
|
253
|
-
onLanded: (hook: LoginLandingHook) => void;
|
|
254
|
-
/** Every registered landing hook, priority-sorted (higher first). */
|
|
255
|
-
landingHooks: () => LoginLandingHook[];
|
|
256
241
|
enter: () => void;
|
|
257
242
|
begin: (request: LoginRequest) => Promise<LoginOutcome>;
|
|
258
243
|
authorize: (url: string) => Promise<LoginOutcome>;
|
|
@@ -265,68 +250,6 @@ export interface LoginService extends LazyService {
|
|
|
265
250
|
/** Drop this document's authentication. The single de-adoption path. */
|
|
266
251
|
revoke: () => Promise<void>;
|
|
267
252
|
}
|
|
268
|
-
/**
|
|
269
|
-
* A step to run after sign-in completes, before the ordinary landing.
|
|
270
|
-
*
|
|
271
|
-
* Registered by a package that must collect something from a freshly authenticated user before
|
|
272
|
-
* the application resumes wherever it was headed — the marketing-consent screen is the first
|
|
273
|
-
* consumer. `landAfterLogin`/`continueLogin` (./land.js) walk the registered steps in priority
|
|
274
|
-
* order and land on the first one whose `pending` resolves `true`.
|
|
275
|
-
*/
|
|
276
|
-
/**
|
|
277
|
-
* The value shape a landing's `params`/`query` carries.
|
|
278
|
-
*
|
|
279
|
-
* Matches `FlowPayload` (`@owlmeans/flow`) and the `AbstractRequest` params/query fields
|
|
280
|
-
* (`@owlmeans/entrypoint`) structurally, rather than the narrower `Record<string, string>`, so a
|
|
281
|
-
* `LoginLanding` can be built directly from either a `SuspendedLandingRecord`'s query or a
|
|
282
|
-
* dispatcher's own forwarded `params`/`query` without a lossy re-cast at every call site.
|
|
283
|
-
*/
|
|
284
|
-
export type LoginLandingParams = Record<string, string | number | boolean | undefined | null>;
|
|
285
|
-
export interface LoginStep {
|
|
286
|
-
alias: string;
|
|
287
|
-
/** Higher runs first. Defaults to 0. */
|
|
288
|
-
priority?: number;
|
|
289
|
-
/** Entrypoint alias to navigate to while this step is pending. */
|
|
290
|
-
entrypoint: string;
|
|
291
|
-
/** Extra query parameters for the landing, alongside the step's own alias. */
|
|
292
|
-
query?: (ctx: LoginContext) => LoginLandingParams | undefined;
|
|
293
|
-
/** Whether this step still has something to collect from the signed-in user. */
|
|
294
|
-
pending: (ctx: LoginContext) => Promise<boolean>;
|
|
295
|
-
}
|
|
296
|
-
/** Where a finished sign-in (or a pending step) lands. */
|
|
297
|
-
export interface LoginLanding {
|
|
298
|
-
alias: string;
|
|
299
|
-
params?: LoginLandingParams;
|
|
300
|
-
query?: LoginLandingParams;
|
|
301
|
-
/** The step alias this landing came from, when it came from one. */
|
|
302
|
-
step?: string;
|
|
303
|
-
}
|
|
304
|
-
/**
|
|
305
|
-
* Observes that a freshly authenticated token has landed — unlike {@link LoginStep}, it never
|
|
306
|
-
* blocks the landing, it only reacts to it, once per distinct token.
|
|
307
|
-
*
|
|
308
|
-
* MUST never throw uncaught: the caller (`landAfterLogin`) bounds and swallows every hook's
|
|
309
|
-
* failure, on a timeout as well as a rejection, so a broken hook can never block sign-in.
|
|
310
|
-
*/
|
|
311
|
-
export interface LoginLandingHook {
|
|
312
|
-
alias: string;
|
|
313
|
-
priority?: number;
|
|
314
|
-
landed: (ctx: LoginContext) => Promise<void>;
|
|
315
|
-
}
|
|
316
|
-
/** Options for {@link LoginService.landAfterLogin}-shaped helpers (./land.js). */
|
|
317
|
-
export interface LandOptions {
|
|
318
|
-
/** Where to land when nothing else claims the flow. Defaults to `{ alias: HOME }`. */
|
|
319
|
-
fallback?: LoginLanding;
|
|
320
|
-
/** `false` skips `resumeSuspendedFlow` — the caller already has its own concrete destination. */
|
|
321
|
-
resume?: boolean;
|
|
322
|
-
/** Skip every step up to and including this alias — the resume point for a step's re-entry. */
|
|
323
|
-
after?: string;
|
|
324
|
-
/**
|
|
325
|
-
* Overrides the step/hook timeout for this call. Mainly for tests; production callers leave it
|
|
326
|
-
* at the default (`LOGIN_STEP_TIMEOUT`).
|
|
327
|
-
*/
|
|
328
|
-
stepTimeout?: number;
|
|
329
|
-
}
|
|
330
253
|
export interface LoginServiceAppend {
|
|
331
254
|
login: () => LoginService;
|
|
332
255
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/login/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACpE,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAClE,OA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kBAAkB;IACjC,KAAK,EAAE,MAAM,YAAY,CAAA;CAC1B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owlmeans/client-auth",
|
|
3
|
-
"version": "0.1.18-rc.
|
|
3
|
+
"version": "0.1.18-rc.44",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -50,26 +50,26 @@
|
|
|
50
50
|
}
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@owlmeans/auth": "^0.1.18-rc.
|
|
54
|
-
"@owlmeans/auth-common": "^0.1.18-rc.
|
|
55
|
-
"@owlmeans/basic-envelope": "^0.1.18-rc.
|
|
56
|
-
"@owlmeans/basic-keys": "^0.1.18-rc.
|
|
57
|
-
"@owlmeans/client": "^0.1.18-rc.
|
|
58
|
-
"@owlmeans/client-context": "^0.1.18-rc.
|
|
59
|
-
"@owlmeans/client-entrypoint": "^0.1.18-rc.
|
|
60
|
-
"@owlmeans/client-flow": "^0.1.18-rc.
|
|
61
|
-
"@owlmeans/client-resource": "^0.1.18-rc.
|
|
62
|
-
"@owlmeans/client-socket": "^0.1.18-rc.
|
|
63
|
-
"@owlmeans/config": "^0.1.18-rc.
|
|
64
|
-
"@owlmeans/context": "^0.1.18-rc.
|
|
65
|
-
"@owlmeans/did": "^0.1.18-rc.
|
|
66
|
-
"@owlmeans/entrypoint": "^0.1.18-rc.
|
|
67
|
-
"@owlmeans/error": "^0.1.18-rc.
|
|
68
|
-
"@owlmeans/flow": "^0.1.18-rc.
|
|
69
|
-
"@owlmeans/i18n": "^0.1.18-rc.
|
|
70
|
-
"@owlmeans/resource": "^0.1.18-rc.
|
|
71
|
-
"@owlmeans/socket": "^0.1.18-rc.
|
|
72
|
-
"@owlmeans/web-flow": "^0.1.18-rc.
|
|
53
|
+
"@owlmeans/auth": "^0.1.18-rc.32",
|
|
54
|
+
"@owlmeans/auth-common": "^0.1.18-rc.34",
|
|
55
|
+
"@owlmeans/basic-envelope": "^0.1.18-rc.33",
|
|
56
|
+
"@owlmeans/basic-keys": "^0.1.18-rc.35",
|
|
57
|
+
"@owlmeans/client": "^0.1.18-rc.37",
|
|
58
|
+
"@owlmeans/client-context": "^0.1.18-rc.35",
|
|
59
|
+
"@owlmeans/client-entrypoint": "^0.1.18-rc.34",
|
|
60
|
+
"@owlmeans/client-flow": "^0.1.18-rc.40",
|
|
61
|
+
"@owlmeans/client-resource": "^0.1.18-rc.34",
|
|
62
|
+
"@owlmeans/client-socket": "^0.1.18-rc.35",
|
|
63
|
+
"@owlmeans/config": "^0.1.18-rc.34",
|
|
64
|
+
"@owlmeans/context": "^0.1.18-rc.30",
|
|
65
|
+
"@owlmeans/did": "^0.1.18-rc.33",
|
|
66
|
+
"@owlmeans/entrypoint": "^0.1.18-rc.33",
|
|
67
|
+
"@owlmeans/error": "^0.1.18-rc.32",
|
|
68
|
+
"@owlmeans/flow": "^0.1.18-rc.35",
|
|
69
|
+
"@owlmeans/i18n": "^0.1.18-rc.33",
|
|
70
|
+
"@owlmeans/resource": "^0.1.18-rc.32",
|
|
71
|
+
"@owlmeans/socket": "^0.1.18-rc.30",
|
|
72
|
+
"@owlmeans/web-flow": "^0.1.18-rc.39",
|
|
73
73
|
"@scure/base": "^2.3.0"
|
|
74
74
|
},
|
|
75
75
|
"peerDependencies": {
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
80
|
"@owlmeans/dep-config": "workspace:*",
|
|
81
|
-
"@owlmeans/test-auth": "^0.1.18-rc.
|
|
81
|
+
"@owlmeans/test-auth": "^0.1.18-rc.33",
|
|
82
82
|
"@types/bun": "^1.4.0",
|
|
83
83
|
"@types/react": "^19.2.17",
|
|
84
84
|
"nodemon": "^3.1.14",
|
|
@@ -9,10 +9,9 @@ import type { AuthService } from '@owlmeans/auth-common'
|
|
|
9
9
|
import { useNavigate } from '@owlmeans/client'
|
|
10
10
|
import type { AbstractRequest } from '@owlmeans/entrypoint'
|
|
11
11
|
import type { FlowService } from '@owlmeans/client-flow'
|
|
12
|
-
import { DEFAULT_ALIAS as FLOW_SERVICE } from '@owlmeans/client-flow'
|
|
12
|
+
import { DEFAULT_ALIAS as FLOW_SERVICE, resumeSuspendedFlow } from '@owlmeans/client-flow'
|
|
13
13
|
import { FLOW_PLACEHOLDER, OidcAuthStep, STD_OIDC_FLOW } from '@owlmeans/flow'
|
|
14
14
|
import { SERVICE_PARAM } from '@owlmeans/web-flow'
|
|
15
|
-
import { landAfterLogin } from '../../login/land.js'
|
|
16
15
|
|
|
17
16
|
export const DispatcherHOC: TDispatcherHOC = Renderer => ({ context, params, alias, query, payload }) => {
|
|
18
17
|
const [forwarding, setForwarding] = useState<StateToken | undefined>()
|
|
@@ -21,40 +20,28 @@ export const DispatcherHOC: TDispatcherHOC = Renderer => ({ context, params, ali
|
|
|
21
20
|
const navigate = useCallback(async () => {
|
|
22
21
|
if (alias == null || alias === DISPATCHER) {
|
|
23
22
|
// A sign-in that started elsewhere — a device or authorization-code consent screen, most
|
|
24
|
-
// commonly — suspended itself here before leaving
|
|
25
|
-
//
|
|
26
|
-
//
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const landing = await landAfterLogin(context)
|
|
30
|
-
if (landing.alias !== HOME) {
|
|
23
|
+
// commonly — suspended itself here before leaving. Resuming it takes priority over the
|
|
24
|
+
// ordinary HOME landing, and does so BEFORE `alias` is overwritten, because once it is
|
|
25
|
+
// `HOME` there is no way back to tell the two cases apart.
|
|
26
|
+
const landing = await resumeSuspendedFlow(context)
|
|
27
|
+
if (landing != null) {
|
|
31
28
|
await navigator.navigate(
|
|
32
|
-
context.entrypoint<ClientEntrypoint<string>>(landing.
|
|
33
|
-
{ params: landing.params, query: landing.query }
|
|
29
|
+
context.entrypoint<ClientEntrypoint<string>>(landing.entrypoint), { query: landing.query }
|
|
34
30
|
)
|
|
35
31
|
return
|
|
36
32
|
}
|
|
37
33
|
alias = HOME
|
|
34
|
+
}
|
|
35
|
+
const module = context.entrypoint<ClientEntrypoint<string>>(alias)
|
|
36
|
+
if (alias === HOME) {
|
|
37
|
+
params = {}
|
|
38
|
+
query = {}
|
|
38
39
|
} else {
|
|
39
|
-
// A concrete destination already exists (an OIDC `?code=` return, etc.) — a registered step
|
|
40
|
-
// still gets to interject, but `resumeSuspendedFlow` must not run a second time: this
|
|
41
|
-
// branch already has somewhere to go.
|
|
42
40
|
query = { ...forwarding?.query, ...query }
|
|
43
41
|
if (query != null && AUTH_QUERY in query) {
|
|
44
42
|
delete query[AUTH_QUERY]
|
|
45
43
|
}
|
|
46
|
-
const landing = await landAfterLogin(
|
|
47
|
-
context, { fallback: { alias, params, query }, resume: false }
|
|
48
|
-
)
|
|
49
|
-
await navigator.navigate(
|
|
50
|
-
context.entrypoint<ClientEntrypoint<string>>(landing.alias),
|
|
51
|
-
{ params: landing.params, query: landing.query }
|
|
52
|
-
)
|
|
53
|
-
return
|
|
54
44
|
}
|
|
55
|
-
const module = context.entrypoint<ClientEntrypoint<string>>(alias)
|
|
56
|
-
params = {}
|
|
57
|
-
query = {}
|
|
58
45
|
await navigator.navigate(module, { params, query })
|
|
59
46
|
}, [forwarding])
|
|
60
47
|
|
package/src/login/i18n/be.json
CHANGED
|
@@ -16,15 +16,11 @@
|
|
|
16
16
|
"fallback": "Працягнуць з {{method}}"
|
|
17
17
|
},
|
|
18
18
|
"terms": {
|
|
19
|
-
"
|
|
19
|
+
"agreement": "Я прачытаў(-ла) і прымаю {{terms}} і {{privacy}}.",
|
|
20
20
|
"terms": "Умовы карыстання",
|
|
21
21
|
"privacy": "Палітыку прыватнасці",
|
|
22
22
|
"cookies": "Палітыку файлаў cookie",
|
|
23
|
-
"
|
|
24
|
-
"product": "Умовы прадукту {{product}}",
|
|
25
|
-
"notice": "Як мы апрацоўваем вашы асабістыя дадзеныя: {{notices}}.",
|
|
26
|
-
"revised": "Апошняе абнаўленне: {{date}}",
|
|
27
|
-
"required": "Каб працягнуць, пацвердзіце {{documents}}."
|
|
23
|
+
"required": "Каб працягнуць, пацвердзіце Умовы карыстання і Палітыку прыватнасці."
|
|
28
24
|
},
|
|
29
25
|
"consent": {
|
|
30
26
|
"required": "Уваход захоўвае сеансавы файл cookie. Прыміце неабходныя файлы cookie, каб працягнуць."
|
package/src/login/i18n/de.json
CHANGED
|
@@ -16,15 +16,11 @@
|
|
|
16
16
|
"fallback": "Mit {{method}} fortfahren"
|
|
17
17
|
},
|
|
18
18
|
"terms": {
|
|
19
|
-
"
|
|
19
|
+
"agreement": "Ich habe die {{terms}} und die {{privacy}} gelesen und stimme ihnen zu.",
|
|
20
20
|
"terms": "Allgemeinen Geschäftsbedingungen",
|
|
21
21
|
"privacy": "Datenschutzerklärung",
|
|
22
22
|
"cookies": "Cookie-Richtlinie",
|
|
23
|
-
"
|
|
24
|
-
"product": "{{product}}-Produktbedingungen",
|
|
25
|
-
"notice": "Wie wir Ihre personenbezogenen Daten verarbeiten: {{notices}}.",
|
|
26
|
-
"revised": "Zuletzt aktualisiert: {{date}}",
|
|
27
|
-
"required": "Bitte bestätigen Sie {{documents}}, um fortzufahren."
|
|
23
|
+
"required": "Bitte bestätigen Sie die Allgemeinen Geschäftsbedingungen und die Datenschutzerklärung, um fortzufahren."
|
|
28
24
|
},
|
|
29
25
|
"consent": {
|
|
30
26
|
"required": "Bei der Anmeldung wird ein Sitzungs-Cookie gespeichert. Akzeptieren Sie die notwendigen Cookies, um fortzufahren."
|
package/src/login/i18n/en.json
CHANGED
|
@@ -16,15 +16,11 @@
|
|
|
16
16
|
"fallback": "Continue with {{method}}"
|
|
17
17
|
},
|
|
18
18
|
"terms": {
|
|
19
|
-
"
|
|
19
|
+
"agreement": "I have read and agree to the {{terms}} and the {{privacy}}.",
|
|
20
20
|
"terms": "Terms & Conditions",
|
|
21
21
|
"privacy": "Privacy Policy",
|
|
22
22
|
"cookies": "Cookie Policy",
|
|
23
|
-
"
|
|
24
|
-
"product": "{{product}} Product Terms",
|
|
25
|
-
"notice": "How we handle your personal data: {{notices}}.",
|
|
26
|
-
"revised": "Last updated: {{date}}",
|
|
27
|
-
"required": "Please confirm the {{documents}} to continue."
|
|
23
|
+
"required": "Please confirm the Terms & Conditions and the Privacy Policy to continue."
|
|
28
24
|
},
|
|
29
25
|
"consent": {
|
|
30
26
|
"required": "Signing in stores a session cookie. Accept essential cookies to continue."
|
package/src/login/i18n/es.json
CHANGED
|
@@ -16,15 +16,11 @@
|
|
|
16
16
|
"fallback": "Continuar con {{method}}"
|
|
17
17
|
},
|
|
18
18
|
"terms": {
|
|
19
|
-
"
|
|
19
|
+
"agreement": "He leído y acepto los {{terms}} y la {{privacy}}.",
|
|
20
20
|
"terms": "Términos y Condiciones",
|
|
21
21
|
"privacy": "Política de Privacidad",
|
|
22
22
|
"cookies": "Política de Cookies",
|
|
23
|
-
"
|
|
24
|
-
"product": "Condiciones del Producto {{product}}",
|
|
25
|
-
"notice": "Cómo tratamos tus datos personales: {{notices}}.",
|
|
26
|
-
"revised": "Última actualización: {{date}}",
|
|
27
|
-
"required": "Confirma {{documents}} para continuar."
|
|
23
|
+
"required": "Confirma los Términos y Condiciones y la Política de Privacidad para continuar."
|
|
28
24
|
},
|
|
29
25
|
"consent": {
|
|
30
26
|
"required": "Iniciar sesión guarda una cookie de sesión. Acepta las cookies esenciales para continuar."
|
package/src/login/i18n/fr.json
CHANGED
|
@@ -16,15 +16,11 @@
|
|
|
16
16
|
"fallback": "Continuer avec {{method}}"
|
|
17
17
|
},
|
|
18
18
|
"terms": {
|
|
19
|
-
"
|
|
19
|
+
"agreement": "J’ai lu et j’accepte les {{terms}} et la {{privacy}}.",
|
|
20
20
|
"terms": "conditions générales",
|
|
21
21
|
"privacy": "politique de confidentialité",
|
|
22
22
|
"cookies": "Politique relative aux cookies",
|
|
23
|
-
"
|
|
24
|
-
"product": "Conditions du produit {{product}}",
|
|
25
|
-
"notice": "Comment nous traitons vos données personnelles : {{notices}}.",
|
|
26
|
-
"revised": "Dernière mise à jour : {{date}}",
|
|
27
|
-
"required": "Confirmez {{documents}} pour continuer."
|
|
23
|
+
"required": "Confirmez les conditions générales et la politique de confidentialité pour continuer."
|
|
28
24
|
},
|
|
29
25
|
"consent": {
|
|
30
26
|
"required": "La connexion enregistre un cookie de session. Acceptez les cookies essentiels pour continuer."
|
package/src/login/i18n/pl.json
CHANGED
|
@@ -16,15 +16,11 @@
|
|
|
16
16
|
"fallback": "Kontynuuj z {{method}}"
|
|
17
17
|
},
|
|
18
18
|
"terms": {
|
|
19
|
-
"
|
|
19
|
+
"agreement": "Przeczytałem(-am) i akceptuję {{terms}} oraz {{privacy}}.",
|
|
20
20
|
"terms": "Regulamin",
|
|
21
21
|
"privacy": "Politykę prywatności",
|
|
22
22
|
"cookies": "Politykę plików cookie",
|
|
23
|
-
"
|
|
24
|
-
"product": "Warunki produktu {{product}}",
|
|
25
|
-
"notice": "Jak przetwarzamy Twoje dane osobowe: {{notices}}.",
|
|
26
|
-
"revised": "Ostatnia aktualizacja: {{date}}",
|
|
27
|
-
"required": "Aby kontynuować, potwierdź {{documents}}."
|
|
23
|
+
"required": "Aby kontynuować, potwierdź Regulamin i Politykę prywatności."
|
|
28
24
|
},
|
|
29
25
|
"consent": {
|
|
30
26
|
"required": "Logowanie zapisuje plik cookie sesji. Zaakceptuj niezbędne pliki cookie, aby kontynuować."
|
package/src/login/i18n/ru.json
CHANGED
|
@@ -16,15 +16,11 @@
|
|
|
16
16
|
"fallback": "Продолжить с {{method}}"
|
|
17
17
|
},
|
|
18
18
|
"terms": {
|
|
19
|
-
"
|
|
19
|
+
"agreement": "Я прочитал(а) и принимаю {{terms}} и {{privacy}}.",
|
|
20
20
|
"terms": "Условия использования",
|
|
21
21
|
"privacy": "Политику конфиденциальности",
|
|
22
22
|
"cookies": "Политику файлов cookie",
|
|
23
|
-
"
|
|
24
|
-
"product": "Условия использования продукта {{product}}",
|
|
25
|
-
"notice": "Как мы обрабатываем ваши персональные данные: {{notices}}.",
|
|
26
|
-
"revised": "Последнее обновление: {{date}}",
|
|
27
|
-
"required": "Чтобы продолжить, подтвердите {{documents}}."
|
|
23
|
+
"required": "Чтобы продолжить, подтвердите Условия использования и Политику конфиденциальности."
|
|
28
24
|
},
|
|
29
25
|
"consent": {
|
|
30
26
|
"required": "Вход сохраняет сессионный файл cookie. Примите необходимые файлы cookie, чтобы продолжить."
|
package/src/login/i18n/uk.json
CHANGED
|
@@ -16,15 +16,11 @@
|
|
|
16
16
|
"fallback": "Продовжити з {{method}}"
|
|
17
17
|
},
|
|
18
18
|
"terms": {
|
|
19
|
-
"
|
|
19
|
+
"agreement": "Я прочитав(-ла) і приймаю {{terms}} та {{privacy}}.",
|
|
20
20
|
"terms": "Умови користування",
|
|
21
21
|
"privacy": "Політику конфіденційності",
|
|
22
22
|
"cookies": "Політику файлів cookie",
|
|
23
|
-
"
|
|
24
|
-
"product": "Умови продукту {{product}}",
|
|
25
|
-
"notice": "Як ми обробляємо ваші персональні дані: {{notices}}.",
|
|
26
|
-
"revised": "Востаннє оновлено: {{date}}",
|
|
27
|
-
"required": "Щоб продовжити, підтвердьте {{documents}}."
|
|
23
|
+
"required": "Щоб продовжити, підтвердьте Умови користування та Політику конфіденційності."
|
|
28
24
|
},
|
|
29
25
|
"consent": {
|
|
30
26
|
"required": "Вхід зберігає сеансовий файл cookie. Прийміть необхідні файли cookie, щоб продовжити."
|
package/src/login/index.ts
CHANGED
|
@@ -7,11 +7,9 @@ export * from './adopt.js'
|
|
|
7
7
|
export * from './methods.js'
|
|
8
8
|
export * from './flow.js'
|
|
9
9
|
export * from './resume.js'
|
|
10
|
-
export * from './terms-config.js'
|
|
11
10
|
export * from './terms.js'
|
|
12
11
|
export * from './credit.js'
|
|
13
12
|
export * from './surrogate.js'
|
|
14
13
|
export * from './screen.js'
|
|
15
14
|
export * from './service.js'
|
|
16
15
|
export * from './hook.js'
|
|
17
|
-
export * from './land.js'
|
package/src/login/screen.tsx
CHANGED
|
@@ -1,46 +1,13 @@
|
|
|
1
1
|
import { useCallback, useState } from 'react'
|
|
2
|
-
import type { CSSProperties, FC
|
|
2
|
+
import type { CSSProperties, FC } from 'react'
|
|
3
3
|
import { useContext } from '@owlmeans/client'
|
|
4
4
|
import type { CommonConfig } from '@owlmeans/config'
|
|
5
5
|
import type { LoginContext, LoginMethod, LoginScreenProps, LoginService } from './types.js'
|
|
6
6
|
import { LOGIN_SERVICE } from './consts.js'
|
|
7
7
|
import { primaryLoginMethod } from './methods.js'
|
|
8
|
-
import { acceptTerms, resolveTerms, termsAccepted
|
|
9
|
-
import type { ResolvedTermsDocument, TermsSentencePart } from './terms.js'
|
|
8
|
+
import { acceptTerms, resolveTerms, termsAccepted } from './terms.js'
|
|
10
9
|
import { resolveCredit } from './credit.js'
|
|
11
10
|
|
|
12
|
-
/** The same English fallbacks `@owlmeans/web-panel`'s `LoginTerms` uses, kept in sync by hand. */
|
|
13
|
-
const DEFAULT_LABEL: Record<string, string> = {
|
|
14
|
-
terms: 'Terms & Conditions',
|
|
15
|
-
privacy: 'Privacy Policy',
|
|
16
|
-
cookies: 'Cookie Policy',
|
|
17
|
-
billing: 'Billing Terms',
|
|
18
|
-
product: '{{product}} Product Terms',
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const resolveLabelFor = (
|
|
22
|
-
translate: (key: string, defaultValue: string) => string, locale: string | undefined
|
|
23
|
-
) => (doc: ResolvedTermsDocument): string => {
|
|
24
|
-
const fromMap = doc.labelMap != null
|
|
25
|
-
? (locale != null ? doc.labelMap[locale] : undefined) ?? Object.values(doc.labelMap)[0]
|
|
26
|
-
: undefined
|
|
27
|
-
let label = doc.label ?? fromMap
|
|
28
|
-
?? (doc.i18nKey != null ? translate(doc.i18nKey, DEFAULT_LABEL[doc.key] ?? doc.key) : doc.key)
|
|
29
|
-
|
|
30
|
-
if (doc.params != null) {
|
|
31
|
-
for (const [key, value] of Object.entries(doc.params)) {
|
|
32
|
-
label = label.split(`{{${key}}}`).join(value)
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return label
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const renderParts = (parts: TermsSentencePart[]): ReactNode =>
|
|
40
|
-
parts.map((part, index) => part.href != null
|
|
41
|
-
? <a key={index} href={part.href} target="_blank" rel="noreferrer noopener">{part.text}</a>
|
|
42
|
-
: <span key={index}>{part.text}</span>)
|
|
43
|
-
|
|
44
11
|
/**
|
|
45
12
|
* The page the card sits in.
|
|
46
13
|
*
|
|
@@ -89,7 +56,6 @@ export const FallbackLoginScreen: FC<LoginScreenProps> = props => {
|
|
|
89
56
|
const env = login.env()
|
|
90
57
|
const resolved = resolveTerms(props.terms ?? cfg?.terms)
|
|
91
58
|
const credit = resolveCredit(cfg?.credit, brand, context.cfg.service)
|
|
92
|
-
const resolveLabel = resolveLabelFor(t, props.locale)
|
|
93
59
|
|
|
94
60
|
const [accepted, setAccepted] = useState(() => termsAccepted(resolved))
|
|
95
61
|
const [attempted, setAttempted] = useState(false)
|
|
@@ -139,36 +105,26 @@ export const FallbackLoginScreen: FC<LoginScreenProps> = props => {
|
|
|
139
105
|
</button>)}
|
|
140
106
|
|
|
141
107
|
{resolved != null && <p style={{ marginTop: '1rem', fontSize: '.875rem' }}>
|
|
142
|
-
{/* The ONLY place `data-login-terms` appears — never duplicated onto a second control. */}
|
|
143
108
|
<label>
|
|
144
109
|
<input
|
|
145
110
|
type="checkbox" checked={accepted} data-login-terms
|
|
146
111
|
onChange={event => onAccept(event.target.checked)}
|
|
147
112
|
/>{' '}
|
|
148
|
-
{
|
|
149
|
-
t('login.terms.accept', 'I have read and agree to the {{documents}}.'),
|
|
150
|
-
resolved, props.locale, resolveLabel
|
|
151
|
-
))}
|
|
113
|
+
{t('login.terms.agreement', 'I have read and agree to the Terms & Conditions and the Privacy Policy.')}
|
|
152
114
|
</label>
|
|
115
|
+
{' '}
|
|
116
|
+
<a href={resolved.terms} target="_blank" rel="noreferrer noopener">
|
|
117
|
+
{t('login.terms.terms', 'Terms & Conditions')}
|
|
118
|
+
</a>
|
|
119
|
+
{' · '}
|
|
120
|
+
<a href={resolved.privacy} target="_blank" rel="noreferrer noopener">
|
|
121
|
+
{t('login.terms.privacy', 'Privacy Policy')}
|
|
122
|
+
</a>
|
|
153
123
|
</p>}
|
|
154
124
|
|
|
155
|
-
{
|
|
156
|
-
{t('login.terms.
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
{/* Outside the checkbox's label: a privacy disclosure is not something it consents to. */}
|
|
160
|
-
{resolved != null && <p data-login-privacy style={{ fontSize: '.875rem' }}>
|
|
161
|
-
{renderParts(termsSentence(
|
|
162
|
-
t('login.terms.notice', 'How we handle your personal data: {{notices}}.'),
|
|
163
|
-
resolved, props.locale, resolveLabel
|
|
164
|
-
))}
|
|
165
|
-
</p>}
|
|
166
|
-
|
|
167
|
-
{attempted && blocked && resolved != null && <p role="alert" style={{ color: '#b00', fontSize: '.875rem' }}>
|
|
168
|
-
{renderParts(termsSentence(
|
|
169
|
-
t('login.terms.required', 'Please confirm the {{documents}} to continue.'),
|
|
170
|
-
resolved, props.locale, resolveLabel
|
|
171
|
-
))}
|
|
125
|
+
{attempted && blocked && <p role="alert" style={{ color: '#b00', fontSize: '.875rem' }}>
|
|
126
|
+
{t('login.terms.required',
|
|
127
|
+
'Please confirm the Terms & Conditions and the Privacy Policy to continue.')}
|
|
172
128
|
</p>}
|
|
173
129
|
|
|
174
130
|
{props.footer ?? <p style={{ marginTop: '2rem', fontSize: '.75rem', opacity: .7 }}>
|
package/src/login/service.ts
CHANGED
|
@@ -7,8 +7,8 @@ import { adoptToken, revokeToken } from './adopt.js'
|
|
|
7
7
|
import { resolveLoginMethods } from './methods.js'
|
|
8
8
|
import { LoginOutcome } from './types.js'
|
|
9
9
|
import type {
|
|
10
|
-
LoginContext,
|
|
11
|
-
LoginScreenComponent, LoginService, LoginServiceAppend
|
|
10
|
+
LoginContext, LoginMethodSource, LoginNotifier, LoginPlugin, LoginPrecondition,
|
|
11
|
+
LoginScreenComponent, LoginService, LoginServiceAppend
|
|
12
12
|
} from './types.js'
|
|
13
13
|
|
|
14
14
|
/**
|
|
@@ -33,8 +33,6 @@ export const makeLoginService = (alias: string = DEFAULT_ALIAS): LoginService =>
|
|
|
33
33
|
const plugins: LoginPlugin[] = []
|
|
34
34
|
const preconditions: LoginPrecondition[] = []
|
|
35
35
|
const methodSources: LoginMethodSource[] = []
|
|
36
|
-
const steps: LoginStep[] = []
|
|
37
|
-
const hooks: LoginLandingHook[] = []
|
|
38
36
|
let screen: LoginScreenComponent | null = null
|
|
39
37
|
let notifier: LoginNotifier | null = null
|
|
40
38
|
|
|
@@ -79,28 +77,6 @@ export const makeLoginService = (alias: string = DEFAULT_ALIAS): LoginService =>
|
|
|
79
77
|
|
|
80
78
|
registerNotifier: value => { notifier = value },
|
|
81
79
|
|
|
82
|
-
registerStep: (step: LoginStep) => {
|
|
83
|
-
const existing = steps.findIndex(candidate => candidate.alias === step.alias)
|
|
84
|
-
if (existing >= 0) {
|
|
85
|
-
steps.splice(existing, 1)
|
|
86
|
-
}
|
|
87
|
-
steps.push(step)
|
|
88
|
-
steps.sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0))
|
|
89
|
-
},
|
|
90
|
-
|
|
91
|
-
steps: () => [...steps],
|
|
92
|
-
|
|
93
|
-
onLanded: (hook: LoginLandingHook) => {
|
|
94
|
-
const existing = hooks.findIndex(candidate => candidate.alias === hook.alias)
|
|
95
|
-
if (existing >= 0) {
|
|
96
|
-
hooks.splice(existing, 1)
|
|
97
|
-
}
|
|
98
|
-
hooks.push(hook)
|
|
99
|
-
hooks.sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0))
|
|
100
|
-
},
|
|
101
|
-
|
|
102
|
-
landingHooks: () => [...hooks],
|
|
103
|
-
|
|
104
80
|
plugin: env => {
|
|
105
81
|
const environment = env ?? defaultLoginEnv()
|
|
106
82
|
const plugin = plugins.find(
|
package/src/login/terms.ts
CHANGED
|
Binary file
|