@owlmeans/client-auth 0.1.18-rc.4 → 0.1.18-rc.41
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 +280 -37
- package/agent-meta/manifest.json +2 -2
- package/agent-meta/skills/client-auth/SKILL.md +139 -21
- package/build/components/dispatcher/component.d.ts.map +1 -1
- package/build/components/dispatcher/component.js +14 -3
- package/build/components/dispatcher/component.js.map +1 -1
- package/build/entrypoints.d.ts +7 -0
- package/build/entrypoints.d.ts.map +1 -0
- package/build/entrypoints.js +7 -0
- package/build/entrypoints.js.map +1 -0
- package/build/helper.d.ts +2 -1
- package/build/helper.d.ts.map +1 -1
- package/build/helper.js +24 -3
- package/build/helper.js.map +1 -1
- package/build/index.d.ts +1 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1 -1
- package/build/index.js.map +1 -1
- package/build/login/adopt.d.ts +24 -0
- package/build/login/adopt.d.ts.map +1 -0
- package/build/login/adopt.js +28 -0
- package/build/login/adopt.js.map +1 -0
- package/build/login/consts.d.ts +49 -0
- package/build/login/consts.d.ts.map +1 -0
- package/build/login/consts.js +49 -0
- package/build/login/consts.js.map +1 -0
- package/build/login/credit.d.ts +24 -0
- package/build/login/credit.d.ts.map +1 -0
- package/build/login/credit.js +58 -0
- package/build/login/credit.js.map +1 -0
- package/build/login/env.d.ts +32 -0
- package/build/login/env.d.ts.map +1 -0
- package/build/login/env.js +84 -0
- package/build/login/env.js.map +1 -0
- package/build/login/flow.d.ts +20 -0
- package/build/login/flow.d.ts.map +1 -0
- package/build/login/flow.js +39 -0
- package/build/login/flow.js.map +1 -0
- package/build/login/hook.d.ts +37 -0
- package/build/login/hook.d.ts.map +1 -0
- package/build/login/hook.js +72 -0
- package/build/login/hook.js.map +1 -0
- package/build/login/i18n/be.json +37 -0
- package/build/login/i18n/de.json +37 -0
- package/build/login/i18n/en.json +37 -0
- package/build/login/i18n/es.json +37 -0
- package/build/login/i18n/fr.json +37 -0
- package/build/login/i18n/pl.json +37 -0
- package/build/login/i18n/ru.json +37 -0
- package/build/login/i18n/uk.json +37 -0
- package/build/login/i18n.d.ts +2 -0
- package/build/login/i18n.d.ts.map +1 -0
- package/build/login/i18n.js +27 -0
- package/build/login/i18n.js.map +1 -0
- package/build/login/index.d.ts +15 -0
- package/build/login/index.d.ts.map +1 -0
- package/build/login/index.js +15 -0
- package/build/login/index.js.map +1 -0
- package/build/login/methods.d.ts +25 -0
- package/build/login/methods.d.ts.map +1 -0
- package/build/login/methods.js +97 -0
- package/build/login/methods.js.map +1 -0
- package/build/login/resume.d.ts +30 -0
- package/build/login/resume.d.ts.map +1 -0
- package/build/login/resume.js +57 -0
- package/build/login/resume.js.map +1 -0
- package/build/login/screen.d.ts +17 -0
- package/build/login/screen.d.ts.map +1 -0
- package/build/login/screen.js +76 -0
- package/build/login/screen.js.map +1 -0
- package/build/login/service.d.ts +31 -0
- package/build/login/service.d.ts.map +1 -0
- package/build/login/service.js +148 -0
- package/build/login/service.js.map +1 -0
- package/build/login/surrogate.d.ts +20 -0
- package/build/login/surrogate.d.ts.map +1 -0
- package/build/login/surrogate.js +33 -0
- package/build/login/surrogate.js.map +1 -0
- package/build/login/terms.d.ts +20 -0
- package/build/login/terms.d.ts.map +1 -0
- package/build/login/terms.js +0 -0
- package/build/login/terms.js.map +1 -0
- package/build/login/types.d.ts +256 -0
- package/build/login/types.d.ts.map +1 -0
- package/build/login/types.js +31 -0
- package/build/login/types.js.map +1 -0
- package/build/manager/components/authentication/control.js +3 -3
- package/build/manager/components/authentication/control.js.map +1 -1
- package/build/manager/components/authentication/types.d.ts +2 -2
- package/build/manager/components/authentication/types.d.ts.map +1 -1
- package/build/manager/components/tunnel-consumer.js +2 -2
- package/build/manager/components/tunnel-consumer.js.map +1 -1
- package/build/manager/entrypoints.d.ts +11 -0
- package/build/manager/entrypoints.d.ts.map +1 -0
- package/build/manager/entrypoints.js +17 -0
- package/build/manager/entrypoints.js.map +1 -0
- package/build/manager/plugins/basic-ed25519.d.ts.map +1 -1
- package/build/manager/plugins/basic-ed25519.js +5 -0
- package/build/manager/plugins/basic-ed25519.js.map +1 -1
- package/build/manager/plugins/exports.d.ts +2 -0
- package/build/manager/plugins/exports.d.ts.map +1 -1
- package/build/manager/plugins/exports.js +2 -0
- package/build/manager/plugins/exports.js.map +1 -1
- package/build/manager/plugins/index.d.ts +1 -5
- package/build/manager/plugins/index.d.ts.map +1 -1
- package/build/manager/plugins/index.js +9 -1
- package/build/manager/plugins/index.js.map +1 -1
- package/build/manager/plugins/methods.d.ts +6 -0
- package/build/manager/plugins/methods.d.ts.map +1 -0
- package/build/manager/plugins/methods.js +65 -0
- package/build/manager/plugins/methods.js.map +1 -0
- package/build/manager/plugins/re-captcha.d.ts.map +1 -1
- package/build/manager/plugins/re-captcha.js +5 -0
- package/build/manager/plugins/re-captcha.js.map +1 -1
- package/build/manager/plugins/registry.d.ts +20 -0
- package/build/manager/plugins/registry.d.ts.map +1 -0
- package/build/manager/plugins/registry.js +19 -0
- package/build/manager/plugins/registry.js.map +1 -0
- package/build/manager/plugins/tunnel-consumer.d.ts.map +1 -1
- package/build/manager/plugins/tunnel-consumer.js +8 -1
- package/build/manager/plugins/tunnel-consumer.js.map +1 -1
- package/build/manager/plugins/types.d.ts +53 -0
- package/build/manager/plugins/types.d.ts.map +1 -1
- package/build/service.js +1 -1
- package/build/service.js.map +1 -1
- package/package.json +36 -27
- package/src/components/dispatcher/component.tsx +16 -3
- package/src/entrypoints.ts +10 -0
- package/src/helper.ts +26 -3
- package/src/index.ts +1 -1
- package/src/login/adopt.ts +31 -0
- package/src/login/consts.ts +64 -0
- package/src/login/credit.ts +75 -0
- package/src/login/env.ts +86 -0
- package/src/login/flow.ts +44 -0
- package/src/login/hook.ts +80 -0
- package/src/login/i18n/be.json +37 -0
- package/src/login/i18n/de.json +37 -0
- package/src/login/i18n/en.json +37 -0
- package/src/login/i18n/es.json +37 -0
- package/src/login/i18n/fr.json +37 -0
- package/src/login/i18n/pl.json +37 -0
- package/src/login/i18n/ru.json +37 -0
- package/src/login/i18n/uk.json +37 -0
- package/src/login/i18n.ts +28 -0
- package/src/login/index.ts +15 -0
- package/src/login/methods.ts +113 -0
- package/src/login/resume.ts +58 -0
- package/src/login/screen.tsx +136 -0
- package/src/login/service.ts +195 -0
- package/src/login/surrogate.ts +45 -0
- package/src/login/terms.ts +0 -0
- package/src/login/types.ts +279 -0
- package/src/manager/README.md +37 -80
- package/src/manager/components/authentication/control.ts +3 -3
- package/src/manager/components/authentication/types.ts +2 -2
- package/src/manager/components/tunnel-consumer.tsx +2 -2
- package/src/manager/entrypoints.ts +18 -0
- package/src/manager/plugins/basic-ed25519.tsx +7 -0
- package/src/manager/plugins/exports.ts +2 -0
- package/src/manager/plugins/index.ts +10 -4
- package/src/manager/plugins/methods.ts +74 -0
- package/src/manager/plugins/re-captcha.tsx +7 -0
- package/src/manager/plugins/registry.ts +26 -0
- package/src/manager/plugins/tunnel-consumer.tsx +10 -1
- package/src/manager/plugins/types.ts +54 -0
- package/src/service.ts +1 -1
- package/tests/context.ts +1 -2
- package/tests/login.spec.ts +332 -0
- package/build/.gitkeep +0 -0
- package/build/manager/modules.d.ts +0 -2
- package/build/manager/modules.d.ts.map +0 -1
- package/build/manager/modules.js +0 -16
- package/build/manager/modules.js.map +0 -1
- package/build/modules.d.ts +0 -4
- package/build/modules.d.ts.map +0 -1
- package/build/modules.js +0 -9
- package/build/modules.js.map +0 -1
- package/src/manager/modules.ts +0 -18
- package/src/modules.ts +0 -13
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { useCallback } from 'react';
|
|
2
|
+
import { useContext, useNavigate } from '@owlmeans/client';
|
|
3
|
+
import { DISPATCHER } from '@owlmeans/auth';
|
|
4
|
+
import { LoginIntent } from './types.js';
|
|
5
|
+
import { LOGIN_SERVICE } from './consts.js';
|
|
6
|
+
import { surrogatePath } from './surrogate.js';
|
|
7
|
+
/**
|
|
8
|
+
* Wiring for a "Log in" control: where it points, and what it does when clicked.
|
|
9
|
+
*
|
|
10
|
+
* The caller renders one control and attaches one handler — which browsing context the flow can
|
|
11
|
+
* actually complete in is the login service's problem, not the app's. An ordinary tab redirects;
|
|
12
|
+
* an app embedded in a frame runs the flow one window up, because the provider refuses to be
|
|
13
|
+
* framed and its cookies are third-party there.
|
|
14
|
+
*
|
|
15
|
+
* The returned handler is deliberately NOT async and awaits nothing before delegating: a window
|
|
16
|
+
* opened after the user gesture has finished being handled is eaten by the popup blocker.
|
|
17
|
+
*
|
|
18
|
+
* The dispatcher entrypoint is resolved INSIDE the hook, never at module scope. Module bodies run
|
|
19
|
+
* while the app is still being imported, before `registerEntrypoints` has put anything on the
|
|
20
|
+
* context, and a top-level lookup throws `Entrypoint dispatcher not found` — which escapes during
|
|
21
|
+
* import, takes the whole render down, and paints an empty page with no component at fault.
|
|
22
|
+
*/
|
|
23
|
+
export const useLogin = (target) => {
|
|
24
|
+
const context = useContext();
|
|
25
|
+
const nav = useNavigate();
|
|
26
|
+
const dispatcher = context.entrypoint(DISPATCHER);
|
|
27
|
+
const path = dispatcher.path();
|
|
28
|
+
const onLogin = useCallback((event) => {
|
|
29
|
+
event?.preventDefault();
|
|
30
|
+
const login = context.service(LOGIN_SERVICE);
|
|
31
|
+
void login.begin({
|
|
32
|
+
url: path,
|
|
33
|
+
target,
|
|
34
|
+
// Only a component may call `useNavigate`, so the in-app continuation is handed to the
|
|
35
|
+
// plugin rather than reinvented by it.
|
|
36
|
+
navigate: () => { nav.go(target ?? DISPATCHER); },
|
|
37
|
+
});
|
|
38
|
+
}, [context, path, target]);
|
|
39
|
+
return [path, onLogin];
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Wiring for a "Log out" control.
|
|
43
|
+
*
|
|
44
|
+
* One control, one handler, no decision — the mirror of {@link useLogin}. Where the session has to
|
|
45
|
+
* be ended (here, or one window up in a surrogate whose storage partition this document cannot
|
|
46
|
+
* reach) is the login plugin's call.
|
|
47
|
+
*
|
|
48
|
+
* NOT async, and nothing is awaited before delegating: logging out of a framed application opens a
|
|
49
|
+
* window, and a window opened after the gesture has finished being handled is eaten by the popup
|
|
50
|
+
* blocker. The surrogate entrypoint is resolved INSIDE the hook for the same reason `useLogin`
|
|
51
|
+
* resolves the dispatcher there.
|
|
52
|
+
*
|
|
53
|
+
* The return shape stays a bare handler rather than `useLogin`'s tuple: a logout control has no
|
|
54
|
+
* address to point at, and every generated application carries a copy of a component that writes
|
|
55
|
+
* `const onLogOut = useLogout()`. `(event?: MouseEvent) => void` is assignable to `() => void`, so
|
|
56
|
+
* `onClick={onLogOut}` keeps compiling everywhere.
|
|
57
|
+
*/
|
|
58
|
+
export const useLogout = (target) => {
|
|
59
|
+
const context = useContext();
|
|
60
|
+
const nav = useNavigate();
|
|
61
|
+
const path = surrogatePath(context, { intent: LoginIntent.Logout });
|
|
62
|
+
return useCallback((event) => {
|
|
63
|
+
event?.preventDefault();
|
|
64
|
+
const login = context.service(LOGIN_SERVICE);
|
|
65
|
+
void login.logout({
|
|
66
|
+
// An application whose entrypoint list predates the surrogate route logs out in place.
|
|
67
|
+
url: path ?? '',
|
|
68
|
+
...(target != null ? { navigate: () => { nav.go(target); } } : {}),
|
|
69
|
+
});
|
|
70
|
+
}, [context, path, target]);
|
|
71
|
+
};
|
|
72
|
+
//# sourceMappingURL=hook.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hook.js","sourceRoot":"","sources":["../../src/login/hook.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AAEnC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAG1D,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAE3C,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,gBA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CAAC,OAAO,CAAe,aAAa,CAAC,CAAA;QAC1D,KAAK,KAAK,CAAC,MAAM,CAAC;YAChB,uFAAuF;YACvF,GAAG,EAAE,IAAI,IAAI,EAAE;YACf,GAAG,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,CAAA,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAClE,CAAC,CAAA;IACJ,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAA;AAC7B,CAAC,CAAA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"login": {
|
|
3
|
+
"title": "Уваход",
|
|
4
|
+
"subtitle": "Абярыце спосаб уваходу.",
|
|
5
|
+
"busy": "Адкрываем акно ўваходу…",
|
|
6
|
+
"empty": "Для гэтай праграмы не наладжаны ніводзін спосаб уваходу.",
|
|
7
|
+
"method": {
|
|
8
|
+
"google": "Працягнуць з Google",
|
|
9
|
+
"oidc": "Працягнуць з {{provider}}",
|
|
10
|
+
"oidc-default": "Увайсці / Зарэгістравацца",
|
|
11
|
+
"oidc-client": "Працягнуць з {{provider}}",
|
|
12
|
+
"basic-ed25519": "Увайсці з ключом",
|
|
13
|
+
"pk-supervisor": "Сакрэтны ключ (аператар)",
|
|
14
|
+
"wallet-consumer": "Гаманец OwlMeans ID",
|
|
15
|
+
"one-time-token": "Увайсці па кодзе з ліста",
|
|
16
|
+
"fallback": "Працягнуць з {{method}}"
|
|
17
|
+
},
|
|
18
|
+
"terms": {
|
|
19
|
+
"agreement": "Я прачытаў(-ла) і прымаю {{terms}} і {{privacy}}.",
|
|
20
|
+
"terms": "Умовы карыстання",
|
|
21
|
+
"privacy": "Палітыку прыватнасці",
|
|
22
|
+
"cookies": "Палітыку файлаў cookie",
|
|
23
|
+
"required": "Каб працягнуць, пацвердзіце Умовы карыстання і Палітыку прыватнасці."
|
|
24
|
+
},
|
|
25
|
+
"consent": {
|
|
26
|
+
"required": "Уваход захоўвае сеансавы файл cookie. Прыміце неабходныя файлы cookie, каб працягнуць."
|
|
27
|
+
},
|
|
28
|
+
"credit": {
|
|
29
|
+
"powered": "Працуе на OwlMeans"
|
|
30
|
+
},
|
|
31
|
+
"error": {
|
|
32
|
+
"failed": "Уваход не завершаны. Паспрабуйце яшчэ раз.",
|
|
33
|
+
"blocked": "Акно ўваходу заблакавана. Націсніце значок заблакаванага ўсплывальнага акна ў адрасным радку браўзера, каб адкрыць яго."
|
|
34
|
+
},
|
|
35
|
+
"orphaned": "Уваход выкананы. Можаце закрыць гэтае акно і вярнуцца ў праграму."
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"login": {
|
|
3
|
+
"title": "Anmelden",
|
|
4
|
+
"subtitle": "Wählen Sie, wie Sie fortfahren möchten.",
|
|
5
|
+
"busy": "Anmeldung wird geöffnet…",
|
|
6
|
+
"empty": "Für diese Anwendung ist keine Anmeldemethode konfiguriert.",
|
|
7
|
+
"method": {
|
|
8
|
+
"google": "Mit Google fortfahren",
|
|
9
|
+
"oidc": "Mit {{provider}} fortfahren",
|
|
10
|
+
"oidc-default": "Anmelden / Registrieren",
|
|
11
|
+
"oidc-client": "Mit {{provider}} fortfahren",
|
|
12
|
+
"basic-ed25519": "Mit einem Schlüssel anmelden",
|
|
13
|
+
"pk-supervisor": "Geheimer Schlüssel (Betreiber)",
|
|
14
|
+
"wallet-consumer": "OwlMeans-ID-Wallet",
|
|
15
|
+
"one-time-token": "Mit einem E-Mail-Code anmelden",
|
|
16
|
+
"fallback": "Mit {{method}} fortfahren"
|
|
17
|
+
},
|
|
18
|
+
"terms": {
|
|
19
|
+
"agreement": "Ich habe die {{terms}} und die {{privacy}} gelesen und stimme ihnen zu.",
|
|
20
|
+
"terms": "Allgemeinen Geschäftsbedingungen",
|
|
21
|
+
"privacy": "Datenschutzerklärung",
|
|
22
|
+
"cookies": "Cookie-Richtlinie",
|
|
23
|
+
"required": "Bitte bestätigen Sie die Allgemeinen Geschäftsbedingungen und die Datenschutzerklärung, um fortzufahren."
|
|
24
|
+
},
|
|
25
|
+
"consent": {
|
|
26
|
+
"required": "Bei der Anmeldung wird ein Sitzungs-Cookie gespeichert. Akzeptieren Sie die notwendigen Cookies, um fortzufahren."
|
|
27
|
+
},
|
|
28
|
+
"credit": {
|
|
29
|
+
"powered": "Betrieben mit OwlMeans"
|
|
30
|
+
},
|
|
31
|
+
"error": {
|
|
32
|
+
"failed": "Die Anmeldung wurde nicht abgeschlossen. Bitte versuchen Sie es erneut.",
|
|
33
|
+
"blocked": "Das Anmeldefenster wurde blockiert. Klicken Sie auf das Symbol für blockierte Pop-ups in der Adressleiste Ihres Browsers, um es zu öffnen."
|
|
34
|
+
},
|
|
35
|
+
"orphaned": "Angemeldet. Sie können dieses Fenster schließen und in der Anwendung fortfahren."
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"login": {
|
|
3
|
+
"title": "Sign in",
|
|
4
|
+
"subtitle": "Choose how you would like to continue.",
|
|
5
|
+
"busy": "Opening sign-in…",
|
|
6
|
+
"empty": "No sign-in method is configured for this application.",
|
|
7
|
+
"method": {
|
|
8
|
+
"google": "Continue with Google",
|
|
9
|
+
"oidc": "Continue with {{provider}}",
|
|
10
|
+
"oidc-default": "Sign in / Sign up",
|
|
11
|
+
"oidc-client": "Continue with {{provider}}",
|
|
12
|
+
"basic-ed25519": "Sign in with a key",
|
|
13
|
+
"pk-supervisor": "Secret key (operator)",
|
|
14
|
+
"wallet-consumer": "OwlMeans ID wallet",
|
|
15
|
+
"one-time-token": "Sign in with an email code",
|
|
16
|
+
"fallback": "Continue with {{method}}"
|
|
17
|
+
},
|
|
18
|
+
"terms": {
|
|
19
|
+
"agreement": "I have read and agree to the {{terms}} and the {{privacy}}.",
|
|
20
|
+
"terms": "Terms & Conditions",
|
|
21
|
+
"privacy": "Privacy Policy",
|
|
22
|
+
"cookies": "Cookie Policy",
|
|
23
|
+
"required": "Please confirm the Terms & Conditions and the Privacy Policy to continue."
|
|
24
|
+
},
|
|
25
|
+
"consent": {
|
|
26
|
+
"required": "Signing in stores a session cookie. Accept essential cookies to continue."
|
|
27
|
+
},
|
|
28
|
+
"credit": {
|
|
29
|
+
"powered": "Powered by OwlMeans"
|
|
30
|
+
},
|
|
31
|
+
"error": {
|
|
32
|
+
"failed": "Sign-in did not complete. Please try again.",
|
|
33
|
+
"blocked": "The sign-in window was blocked. Click the blocked pop-up icon in your browser's address bar to open it."
|
|
34
|
+
},
|
|
35
|
+
"orphaned": "Signed in. You can close this window and continue in the application."
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"login": {
|
|
3
|
+
"title": "Iniciar sesión",
|
|
4
|
+
"subtitle": "Elige cómo quieres continuar.",
|
|
5
|
+
"busy": "Abriendo el inicio de sesión…",
|
|
6
|
+
"empty": "No hay ningún método de inicio de sesión configurado para esta aplicación.",
|
|
7
|
+
"method": {
|
|
8
|
+
"google": "Continuar con Google",
|
|
9
|
+
"oidc": "Continuar con {{provider}}",
|
|
10
|
+
"oidc-default": "Iniciar sesión / Registrarse",
|
|
11
|
+
"oidc-client": "Continuar con {{provider}}",
|
|
12
|
+
"basic-ed25519": "Iniciar sesión con una clave",
|
|
13
|
+
"pk-supervisor": "Clave secreta (operador)",
|
|
14
|
+
"wallet-consumer": "Cartera OwlMeans ID",
|
|
15
|
+
"one-time-token": "Iniciar sesión con un código por correo",
|
|
16
|
+
"fallback": "Continuar con {{method}}"
|
|
17
|
+
},
|
|
18
|
+
"terms": {
|
|
19
|
+
"agreement": "He leído y acepto los {{terms}} y la {{privacy}}.",
|
|
20
|
+
"terms": "Términos y Condiciones",
|
|
21
|
+
"privacy": "Política de Privacidad",
|
|
22
|
+
"cookies": "Política de Cookies",
|
|
23
|
+
"required": "Confirma los Términos y Condiciones y la Política de Privacidad para continuar."
|
|
24
|
+
},
|
|
25
|
+
"consent": {
|
|
26
|
+
"required": "Iniciar sesión guarda una cookie de sesión. Acepta las cookies esenciales para continuar."
|
|
27
|
+
},
|
|
28
|
+
"credit": {
|
|
29
|
+
"powered": "Con tecnología de OwlMeans"
|
|
30
|
+
},
|
|
31
|
+
"error": {
|
|
32
|
+
"failed": "El inicio de sesión no se completó. Inténtalo de nuevo.",
|
|
33
|
+
"blocked": "Se bloqueó la ventana de inicio de sesión. Haz clic en el icono de ventana emergente bloqueada en la barra de direcciones del navegador para abrirla."
|
|
34
|
+
},
|
|
35
|
+
"orphaned": "Sesión iniciada. Puedes cerrar esta ventana y continuar en la aplicación."
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"login": {
|
|
3
|
+
"title": "Connexion",
|
|
4
|
+
"subtitle": "Choisissez comment continuer.",
|
|
5
|
+
"busy": "Ouverture de la connexion…",
|
|
6
|
+
"empty": "Aucune méthode de connexion n’est configurée pour cette application.",
|
|
7
|
+
"method": {
|
|
8
|
+
"google": "Continuer avec Google",
|
|
9
|
+
"oidc": "Continuer avec {{provider}}",
|
|
10
|
+
"oidc-default": "Connexion / Inscription",
|
|
11
|
+
"oidc-client": "Continuer avec {{provider}}",
|
|
12
|
+
"basic-ed25519": "Se connecter avec une clé",
|
|
13
|
+
"pk-supervisor": "Clé secrète (opérateur)",
|
|
14
|
+
"wallet-consumer": "Portefeuille d’identité OwlMeans",
|
|
15
|
+
"one-time-token": "Se connecter avec un code e-mail",
|
|
16
|
+
"fallback": "Continuer avec {{method}}"
|
|
17
|
+
},
|
|
18
|
+
"terms": {
|
|
19
|
+
"agreement": "J’ai lu et j’accepte les {{terms}} et la {{privacy}}.",
|
|
20
|
+
"terms": "conditions générales",
|
|
21
|
+
"privacy": "politique de confidentialité",
|
|
22
|
+
"cookies": "Politique relative aux cookies",
|
|
23
|
+
"required": "Confirmez les conditions générales et la politique de confidentialité pour continuer."
|
|
24
|
+
},
|
|
25
|
+
"consent": {
|
|
26
|
+
"required": "La connexion enregistre un cookie de session. Acceptez les cookies essentiels pour continuer."
|
|
27
|
+
},
|
|
28
|
+
"credit": {
|
|
29
|
+
"powered": "Propulsé par OwlMeans"
|
|
30
|
+
},
|
|
31
|
+
"error": {
|
|
32
|
+
"failed": "La connexion n’a pas abouti. Réessayez.",
|
|
33
|
+
"blocked": "La fenêtre de connexion a été bloquée. Cliquez sur l’icône de fenêtre contextuelle bloquée dans la barre d’adresse pour l’ouvrir."
|
|
34
|
+
},
|
|
35
|
+
"orphaned": "Vous êtes connecté. Vous pouvez fermer cette fenêtre et continuer dans l’application."
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"login": {
|
|
3
|
+
"title": "Zaloguj się",
|
|
4
|
+
"subtitle": "Wybierz sposób, w jaki chcesz kontynuować.",
|
|
5
|
+
"busy": "Otwieranie logowania…",
|
|
6
|
+
"empty": "Dla tej aplikacji nie skonfigurowano żadnej metody logowania.",
|
|
7
|
+
"method": {
|
|
8
|
+
"google": "Kontynuuj z Google",
|
|
9
|
+
"oidc": "Kontynuuj z {{provider}}",
|
|
10
|
+
"oidc-default": "Zaloguj się / Zarejestruj się",
|
|
11
|
+
"oidc-client": "Kontynuuj z {{provider}}",
|
|
12
|
+
"basic-ed25519": "Zaloguj się kluczem",
|
|
13
|
+
"pk-supervisor": "Klucz tajny (operator)",
|
|
14
|
+
"wallet-consumer": "Portfel OwlMeans ID",
|
|
15
|
+
"one-time-token": "Zaloguj się kodem e-mail",
|
|
16
|
+
"fallback": "Kontynuuj z {{method}}"
|
|
17
|
+
},
|
|
18
|
+
"terms": {
|
|
19
|
+
"agreement": "Przeczytałem(-am) i akceptuję {{terms}} oraz {{privacy}}.",
|
|
20
|
+
"terms": "Regulamin",
|
|
21
|
+
"privacy": "Politykę prywatności",
|
|
22
|
+
"cookies": "Politykę plików cookie",
|
|
23
|
+
"required": "Aby kontynuować, potwierdź Regulamin i Politykę prywatności."
|
|
24
|
+
},
|
|
25
|
+
"consent": {
|
|
26
|
+
"required": "Logowanie zapisuje plik cookie sesji. Zaakceptuj niezbędne pliki cookie, aby kontynuować."
|
|
27
|
+
},
|
|
28
|
+
"credit": {
|
|
29
|
+
"powered": "Napędzane przez OwlMeans"
|
|
30
|
+
},
|
|
31
|
+
"error": {
|
|
32
|
+
"failed": "Logowanie nie zostało ukończone. Spróbuj ponownie.",
|
|
33
|
+
"blocked": "Okno logowania zostało zablokowane. Kliknij ikonę zablokowanego okienka w pasku adresu przeglądarki, aby je otworzyć."
|
|
34
|
+
},
|
|
35
|
+
"orphaned": "Zalogowano. Możesz zamknąć to okno i kontynuować w aplikacji."
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"login": {
|
|
3
|
+
"title": "Вход",
|
|
4
|
+
"subtitle": "Выберите способ входа.",
|
|
5
|
+
"busy": "Открываем окно входа…",
|
|
6
|
+
"empty": "Для этого приложения не настроен ни один способ входа.",
|
|
7
|
+
"method": {
|
|
8
|
+
"google": "Продолжить с Google",
|
|
9
|
+
"oidc": "Продолжить с {{provider}}",
|
|
10
|
+
"oidc-default": "Войти / Зарегистрироваться",
|
|
11
|
+
"oidc-client": "Продолжить с {{provider}}",
|
|
12
|
+
"basic-ed25519": "Войти с ключом",
|
|
13
|
+
"pk-supervisor": "Секретный ключ (оператор)",
|
|
14
|
+
"wallet-consumer": "Кошелёк OwlMeans ID",
|
|
15
|
+
"one-time-token": "Войти по коду из письма",
|
|
16
|
+
"fallback": "Продолжить с {{method}}"
|
|
17
|
+
},
|
|
18
|
+
"terms": {
|
|
19
|
+
"agreement": "Я прочитал(а) и принимаю {{terms}} и {{privacy}}.",
|
|
20
|
+
"terms": "Условия использования",
|
|
21
|
+
"privacy": "Политику конфиденциальности",
|
|
22
|
+
"cookies": "Политику файлов cookie",
|
|
23
|
+
"required": "Чтобы продолжить, подтвердите Условия использования и Политику конфиденциальности."
|
|
24
|
+
},
|
|
25
|
+
"consent": {
|
|
26
|
+
"required": "Вход сохраняет сессионный файл cookie. Примите необходимые файлы cookie, чтобы продолжить."
|
|
27
|
+
},
|
|
28
|
+
"credit": {
|
|
29
|
+
"powered": "Работает на OwlMeans"
|
|
30
|
+
},
|
|
31
|
+
"error": {
|
|
32
|
+
"failed": "Вход не завершён. Попробуйте ещё раз.",
|
|
33
|
+
"blocked": "Окно входа заблокировано. Нажмите на значок заблокированного всплывающего окна в адресной строке браузера, чтобы открыть его."
|
|
34
|
+
},
|
|
35
|
+
"orphaned": "Вход выполнен. Можете закрыть это окно и вернуться в приложение."
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"login": {
|
|
3
|
+
"title": "Вхід",
|
|
4
|
+
"subtitle": "Оберіть спосіб входу.",
|
|
5
|
+
"busy": "Відкриваємо вікно входу…",
|
|
6
|
+
"empty": "Для цього застосунку не налаштовано жодного способу входу.",
|
|
7
|
+
"method": {
|
|
8
|
+
"google": "Продовжити з Google",
|
|
9
|
+
"oidc": "Продовжити з {{provider}}",
|
|
10
|
+
"oidc-default": "Увійти / Зареєструватися",
|
|
11
|
+
"oidc-client": "Продовжити з {{provider}}",
|
|
12
|
+
"basic-ed25519": "Увійти з ключем",
|
|
13
|
+
"pk-supervisor": "Секретний ключ (оператор)",
|
|
14
|
+
"wallet-consumer": "Гаманець OwlMeans ID",
|
|
15
|
+
"one-time-token": "Увійти за кодом з листа",
|
|
16
|
+
"fallback": "Продовжити з {{method}}"
|
|
17
|
+
},
|
|
18
|
+
"terms": {
|
|
19
|
+
"agreement": "Я прочитав(-ла) і приймаю {{terms}} та {{privacy}}.",
|
|
20
|
+
"terms": "Умови користування",
|
|
21
|
+
"privacy": "Політику конфіденційності",
|
|
22
|
+
"cookies": "Політику файлів cookie",
|
|
23
|
+
"required": "Щоб продовжити, підтвердьте Умови користування та Політику конфіденційності."
|
|
24
|
+
},
|
|
25
|
+
"consent": {
|
|
26
|
+
"required": "Вхід зберігає сеансовий файл cookie. Прийміть необхідні файли cookie, щоб продовжити."
|
|
27
|
+
},
|
|
28
|
+
"credit": {
|
|
29
|
+
"powered": "Працює на OwlMeans"
|
|
30
|
+
},
|
|
31
|
+
"error": {
|
|
32
|
+
"failed": "Вхід не завершено. Спробуйте ще раз.",
|
|
33
|
+
"blocked": "Вікно входу заблоковано. Натисніть значок заблокованого спливаючого вікна в адресному рядку браузера, щоб відкрити його."
|
|
34
|
+
},
|
|
35
|
+
"orphaned": "Вхід виконано. Можете закрити це вікно й повернутися до застосунку."
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../src/login/i18n.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { addI18nLib } from '@owlmeans/i18n';
|
|
2
|
+
import en from './i18n/en.json' with { type: 'json' };
|
|
3
|
+
import pl from './i18n/pl.json' with { type: 'json' };
|
|
4
|
+
import ru from './i18n/ru.json' with { type: 'json' };
|
|
5
|
+
import be from './i18n/be.json' with { type: 'json' };
|
|
6
|
+
import uk from './i18n/uk.json' with { type: 'json' };
|
|
7
|
+
import es from './i18n/es.json' with { type: 'json' };
|
|
8
|
+
import de from './i18n/de.json' with { type: 'json' };
|
|
9
|
+
import fr from './i18n/fr.json' with { type: 'json' };
|
|
10
|
+
/**
|
|
11
|
+
* The sign-in screen's copy, registered into the `auth` library resource.
|
|
12
|
+
*
|
|
13
|
+
* `_addI18n` PUSHES rather than replaces, so this coexists with `@owlmeans/web-client`'s own
|
|
14
|
+
* `auth` registration (which owns `dispatcher.*` and `surrogate.*`) and the two merge by tier and
|
|
15
|
+
* priority. Registering here rather than in a UI package is what lets the plain fallback screen
|
|
16
|
+
* and every styled one read the same keys — so the seven-language rule holds on every path a user
|
|
17
|
+
* can actually reach, not only the pretty one.
|
|
18
|
+
*/
|
|
19
|
+
addI18nLib('en', 'auth', en);
|
|
20
|
+
addI18nLib('pl', 'auth', pl);
|
|
21
|
+
addI18nLib('ru', 'auth', ru);
|
|
22
|
+
addI18nLib('be', 'auth', be);
|
|
23
|
+
addI18nLib('uk', 'auth', uk);
|
|
24
|
+
addI18nLib('es', 'auth', es);
|
|
25
|
+
addI18nLib('de', 'auth', de);
|
|
26
|
+
addI18nLib('fr', 'auth', fr);
|
|
27
|
+
//# sourceMappingURL=i18n.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../../src/login/i18n.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAE3C,OAAO,EAAE,MAAM,gBAAgB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AACrD,OAAO,EAAE,MAAM,gBAAgB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AACrD,OAAO,EAAE,MAAM,gBAAgB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AACrD,OAAO,EAAE,MAAM,gBAAgB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AACrD,OAAO,EAAE,MAAM,gBAAgB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AACrD,OAAO,EAAE,MAAM,gBAAgB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AACrD,OAAO,EAAE,MAAM,gBAAgB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AACrD,OAAO,EAAE,MAAM,gBAAgB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AAErD;;;;;;;;GAQG;AACH,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,CAAA;AAC5B,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,CAAA;AAC5B,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,CAAA;AAC5B,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,CAAA;AAC5B,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,CAAA;AAC5B,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,CAAA;AAC5B,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,CAAA;AAC5B,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import './i18n.js';
|
|
2
|
+
export * from './consts.js';
|
|
3
|
+
export * from './types.js';
|
|
4
|
+
export * from './env.js';
|
|
5
|
+
export * from './adopt.js';
|
|
6
|
+
export * from './methods.js';
|
|
7
|
+
export * from './flow.js';
|
|
8
|
+
export * from './resume.js';
|
|
9
|
+
export * from './terms.js';
|
|
10
|
+
export * from './credit.js';
|
|
11
|
+
export * from './surrogate.js';
|
|
12
|
+
export * from './screen.js';
|
|
13
|
+
export * from './service.js';
|
|
14
|
+
export * from './hook.js';
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/login/index.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,CAAA;AAElB,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import './i18n.js';
|
|
2
|
+
export * from './consts.js';
|
|
3
|
+
export * from './types.js';
|
|
4
|
+
export * from './env.js';
|
|
5
|
+
export * from './adopt.js';
|
|
6
|
+
export * from './methods.js';
|
|
7
|
+
export * from './flow.js';
|
|
8
|
+
export * from './resume.js';
|
|
9
|
+
export * from './terms.js';
|
|
10
|
+
export * from './credit.js';
|
|
11
|
+
export * from './surrogate.js';
|
|
12
|
+
export * from './screen.js';
|
|
13
|
+
export * from './service.js';
|
|
14
|
+
export * from './hook.js';
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/login/index.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,CAAA;AAElB,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { LoginScreenConfig } from '@owlmeans/config';
|
|
2
|
+
import type { LoginMethod, LoginMethodContext, LoginMethodSource } from './types.js';
|
|
3
|
+
export declare const registerMethodSource: (source: LoginMethodSource) => void;
|
|
4
|
+
export declare const listMethodSources: () => LoginMethodSource[];
|
|
5
|
+
/**
|
|
6
|
+
* Everything the current environment may be offered, in the order it should be offered in.
|
|
7
|
+
*
|
|
8
|
+
* Resolution order matters and is not arbitrary:
|
|
9
|
+
*
|
|
10
|
+
* 1. Sources produce candidates. A source that throws is skipped rather than taking the screen
|
|
11
|
+
* down — a misconfigured provider list must not remove the sign-in method that does work.
|
|
12
|
+
* 2. `restricted` candidates are dropped unless the configuration named them, which is what makes
|
|
13
|
+
* an operator login opt-in rather than merely unadvertised.
|
|
14
|
+
* 3. An explicit `methods` list is both a filter AND the order, because an app that bothered to
|
|
15
|
+
* list them means that list.
|
|
16
|
+
*/
|
|
17
|
+
export declare const resolveLoginMethods: (ctx: LoginMethodContext, cfg?: LoginScreenConfig, extra?: LoginMethodSource[]) => LoginMethod[];
|
|
18
|
+
/**
|
|
19
|
+
* The method a screen highlights and focuses.
|
|
20
|
+
*
|
|
21
|
+
* The first `primary` one, else the first offered. It is highlighted, never started: requirement
|
|
22
|
+
* one of this whole feature is that nothing leaves the document without a click.
|
|
23
|
+
*/
|
|
24
|
+
export declare const primaryLoginMethod: (methods: LoginMethod[]) => LoginMethod | null;
|
|
25
|
+
//# sourceMappingURL=methods.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"methods.d.ts","sourceRoot":"","sources":["../../src/login/methods.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAqB,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAE5E,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAgBpF,eAAO,MAAM,oBAAoB,WAAY,iBAAiB,KAAG,IAMhE,CAAA;AAED,eAAO,MAAM,iBAAiB,QAAO,iBAAiB,EAAkB,CAAA;AAiBxE;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,QACzB,kBAAkB,QAAQ,iBAAiB,UAAS,iBAAiB,EAAE,KAC3E,WAAW,EA8Cb,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,YAAa,WAAW,EAAE,KAAG,WAAW,GAAG,IACG,CAAA"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { DEFAULT_METHOD_ORDER } from './consts.js';
|
|
2
|
+
/**
|
|
3
|
+
* The module-global registry of method SOURCES.
|
|
4
|
+
*
|
|
5
|
+
* A source, rather than a method, because the two things that offer sign-in methods answer
|
|
6
|
+
* different questions at different times: the plugin registry knows what code is loaded, and the
|
|
7
|
+
* OIDC configuration knows what an entity is federated with. Both are answered per render — a
|
|
8
|
+
* provider list can arrive from the api-config middleware after the first paint.
|
|
9
|
+
*
|
|
10
|
+
* Global, like the `AuthenticationPlugin` map it mirrors, because a package registers its source
|
|
11
|
+
* from a side-effect import that has no context to hang it on. A context-scoped registry exists
|
|
12
|
+
* alongside it on the login service, and both are merged by {@link resolveLoginMethods}.
|
|
13
|
+
*/
|
|
14
|
+
const sources = [];
|
|
15
|
+
export const registerMethodSource = (source) => {
|
|
16
|
+
const existing = sources.findIndex(candidate => candidate.alias === source.alias);
|
|
17
|
+
if (existing >= 0) {
|
|
18
|
+
sources.splice(existing, 1);
|
|
19
|
+
}
|
|
20
|
+
sources.push(source);
|
|
21
|
+
};
|
|
22
|
+
export const listMethodSources = () => [...sources];
|
|
23
|
+
/** Normalize a config entry, which may be a bare id or a full override object. */
|
|
24
|
+
const asConfig = (entry) => typeof entry === 'string' ? { id: entry } : entry;
|
|
25
|
+
const merge = (method, override) => override == null ? method : {
|
|
26
|
+
...method,
|
|
27
|
+
...(override.label != null ? { label: override.label } : {}),
|
|
28
|
+
...(override.i18nKey != null ? { i18nKey: override.i18nKey } : {}),
|
|
29
|
+
...(override.icon != null ? { icon: override.icon } : {}),
|
|
30
|
+
...(override.order != null ? { order: override.order } : {}),
|
|
31
|
+
...(override.emphasis != null ? { emphasis: override.emphasis } : {}),
|
|
32
|
+
...(override.params != null ? { params: { ...method.params, ...override.params } } : {}),
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Everything the current environment may be offered, in the order it should be offered in.
|
|
36
|
+
*
|
|
37
|
+
* Resolution order matters and is not arbitrary:
|
|
38
|
+
*
|
|
39
|
+
* 1. Sources produce candidates. A source that throws is skipped rather than taking the screen
|
|
40
|
+
* down — a misconfigured provider list must not remove the sign-in method that does work.
|
|
41
|
+
* 2. `restricted` candidates are dropped unless the configuration named them, which is what makes
|
|
42
|
+
* an operator login opt-in rather than merely unadvertised.
|
|
43
|
+
* 3. An explicit `methods` list is both a filter AND the order, because an app that bothered to
|
|
44
|
+
* list them means that list.
|
|
45
|
+
*/
|
|
46
|
+
export const resolveLoginMethods = (ctx, cfg, extra = []) => {
|
|
47
|
+
const candidates = [];
|
|
48
|
+
for (const source of [...sources, ...extra]) {
|
|
49
|
+
try {
|
|
50
|
+
candidates.push(...source.list(ctx));
|
|
51
|
+
}
|
|
52
|
+
catch (e) {
|
|
53
|
+
console.error(`login: method source "${source.alias}" failed`, e);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
const overrides = cfg?.overrides ?? {};
|
|
57
|
+
const listed = cfg?.methods?.map(asConfig);
|
|
58
|
+
const listedIds = listed?.map(entry => entry.id).filter((id) => id != null);
|
|
59
|
+
const offered = candidates
|
|
60
|
+
.filter(method => {
|
|
61
|
+
const override = overrides[method.id] ?? listed?.find(entry => entry.id === method.id);
|
|
62
|
+
if (override?.enabled === false || override?.hidden === true) {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
// A restricted method is offered only where the configuration asked for it — by naming it in
|
|
66
|
+
// `methods`, or by enabling it in `overrides`. Registering the plugin is deliberately not
|
|
67
|
+
// enough: an operator login that appears wherever its code happens to be bundled is an
|
|
68
|
+
// operator login in production.
|
|
69
|
+
if (method.restricted === true
|
|
70
|
+
&& listedIds?.includes(method.id) !== true
|
|
71
|
+
&& override?.enabled !== true) {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
return true;
|
|
75
|
+
})
|
|
76
|
+
.map(method => merge(method, overrides[method.id]));
|
|
77
|
+
if (listedIds != null) {
|
|
78
|
+
return listedIds
|
|
79
|
+
.map(id => {
|
|
80
|
+
const method = offered.find(candidate => candidate.id === id);
|
|
81
|
+
return method != null ? merge(method, listed?.find(entry => entry.id === id)) : null;
|
|
82
|
+
})
|
|
83
|
+
.filter((method) => method != null);
|
|
84
|
+
}
|
|
85
|
+
return offered.sort((a, b) => {
|
|
86
|
+
const order = (a.order ?? DEFAULT_METHOD_ORDER) - (b.order ?? DEFAULT_METHOD_ORDER);
|
|
87
|
+
return order !== 0 ? order : a.id.localeCompare(b.id);
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* The method a screen highlights and focuses.
|
|
92
|
+
*
|
|
93
|
+
* The first `primary` one, else the first offered. It is highlighted, never started: requirement
|
|
94
|
+
* one of this whole feature is that nothing leaves the document without a click.
|
|
95
|
+
*/
|
|
96
|
+
export const primaryLoginMethod = (methods) => methods.find(method => method.emphasis === 'primary') ?? methods[0] ?? null;
|
|
97
|
+
//# sourceMappingURL=methods.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"methods.js","sourceRoot":"","sources":["../../src/login/methods.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAGlD;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,GAAwB,EAAE,CAAA;AAEvC,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,MAAyB,EAAQ,EAAE;IACtE,MAAM,QAAQ,GAAG,OAAO,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,KAAK,KAAK,MAAM,CAAC,KAAK,CAAC,CAAA;IACjF,IAAI,QAAQ,IAAI,CAAC,EAAE,CAAC;QAClB,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAA;IAC7B,CAAC;IACD,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;AACtB,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,i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AAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;IACvD,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,OAAsB,EAAsB,EAAE,CAC/E,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,QAAQ,KAAK,SAAS,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,IAAI,IAAI,CAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { LoginOutcome } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* The message key a FINISHED sign-in attempt should show, or null when it actually went somewhere.
|
|
4
|
+
*
|
|
5
|
+
* A dispatcher may treat `Passed` as "carry on with the ordinary continuation", because it has one.
|
|
6
|
+
* A screen does not: the user clicked, the document did not move, and nothing rendered — which is
|
|
7
|
+
* indistinguishable from a broken button, and is exactly how a null authorization URL used to
|
|
8
|
+
* present itself. Every outcome that leaves the user looking at the same screen therefore has to
|
|
9
|
+
* say something.
|
|
10
|
+
*/
|
|
11
|
+
export declare const loginAttemptError: (outcome: LoginOutcome | null) => string | null;
|
|
12
|
+
/** What a dispatcher does once `login().resume(...)` has answered. */
|
|
13
|
+
export declare enum ResumeAction {
|
|
14
|
+
/** The plugin took it over — the browser is leaving, or the window is closing. */
|
|
15
|
+
Stop = "stop",
|
|
16
|
+
/** Render the outcome to the user; there is nothing further to do automatically. */
|
|
17
|
+
Render = "render",
|
|
18
|
+
/** Ordinary tab: keep the session and carry on to the application. */
|
|
19
|
+
Navigate = "navigate"
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The one reading of a `resume` outcome, shared by every dispatcher.
|
|
23
|
+
*
|
|
24
|
+
* Exported as a pure function because three dispatchers — `web-client`, `web-oidc-rp` and
|
|
25
|
+
* `mui-oidc-rp` — have to agree on it, and the last time they each held their own copy of a
|
|
26
|
+
* decision they drifted, which is how a popup came to render the application inside itself in two
|
|
27
|
+
* packages at once. It is also the whole rule, so it is testable without a DOM.
|
|
28
|
+
*/
|
|
29
|
+
export declare const resumeAction: (outcome: LoginOutcome) => ResumeAction;
|
|
30
|
+
//# sourceMappingURL=resume.d.ts.map
|