@owlmeans/client-auth 0.1.19-rc.0 → 0.1.19
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 +4 -2
- package/agent-meta/skills/client-auth/SKILL.md +36 -3
- package/agent-meta/skills/client-auth/parts/login.md +2 -1
- package/build/components/dispatcher/component.d.ts.map +1 -1
- package/build/components/dispatcher/component.js +44 -5
- package/build/components/dispatcher/component.js.map +1 -1
- package/build/entrypoints.d.ts +2 -4
- package/build/entrypoints.d.ts.map +1 -1
- package/build/login/consts.local.d.ts +4 -0
- package/build/login/consts.local.d.ts.map +1 -1
- package/build/login/consts.local.js +8 -0
- package/build/login/consts.local.js.map +1 -1
- package/build/login/failure/consts.d.ts +17 -0
- package/build/login/failure/consts.d.ts.map +1 -0
- package/build/login/failure/consts.js +18 -0
- package/build/login/failure/consts.js.map +1 -0
- package/build/login/failure/consts.local.d.ts +17 -0
- package/build/login/failure/consts.local.d.ts.map +1 -0
- package/build/login/failure/consts.local.js +30 -0
- package/build/login/failure/consts.local.js.map +1 -0
- package/build/login/failure/types.d.ts +57 -0
- package/build/login/failure/types.d.ts.map +1 -0
- package/build/login/failure/types.js +2 -0
- package/build/login/failure/types.js.map +1 -0
- package/build/login/failure-view.d.ts +14 -0
- package/build/login/failure-view.d.ts.map +1 -0
- package/build/login/failure-view.js +19 -0
- package/build/login/failure-view.js.map +1 -0
- package/build/login/failure.d.ts +4 -0
- package/build/login/failure.d.ts.map +1 -0
- package/build/login/failure.js +50 -0
- package/build/login/failure.js.map +1 -0
- package/build/login/i18n/be.json +7 -1
- package/build/login/i18n/de.json +7 -1
- package/build/login/i18n/en.json +7 -1
- package/build/login/i18n/es.json +7 -1
- package/build/login/i18n/fr.json +7 -1
- package/build/login/i18n/pl.json +7 -1
- package/build/login/i18n/ru.json +7 -1
- package/build/login/i18n/uk.json +7 -1
- package/build/login/index.d.ts +5 -0
- package/build/login/index.d.ts.map +1 -1
- package/build/login/index.js +4 -0
- package/build/login/index.js.map +1 -1
- package/build/login/screen.d.ts.map +1 -1
- package/build/login/screen.js +9 -2
- package/build/login/screen.js.map +1 -1
- package/build/login/translate.d.ts +15 -0
- package/build/login/translate.d.ts.map +1 -0
- package/build/login/translate.js +26 -0
- package/build/login/translate.js.map +1 -0
- package/build/login/types.d.ts +7 -0
- package/build/login/types.d.ts.map +1 -1
- package/build/manager/entrypoints.d.ts +1 -9
- package/build/manager/entrypoints.d.ts.map +1 -1
- package/package.json +27 -24
- package/src/components/dispatcher/component.tsx +48 -5
- package/src/login/consts.local.ts +10 -0
- package/src/login/failure/consts.local.ts +35 -0
- package/src/login/failure/consts.ts +16 -0
- package/src/login/failure/types.ts +60 -0
- package/src/login/failure-view.tsx +35 -0
- package/src/login/failure.ts +67 -0
- package/src/login/i18n/be.json +7 -1
- package/src/login/i18n/de.json +7 -1
- package/src/login/i18n/en.json +7 -1
- package/src/login/i18n/es.json +7 -1
- package/src/login/i18n/fr.json +7 -1
- package/src/login/i18n/pl.json +7 -1
- package/src/login/i18n/ru.json +7 -1
- package/src/login/i18n/uk.json +7 -1
- package/src/login/index.ts +5 -0
- package/src/login/screen.tsx +13 -1
- package/src/login/translate.ts +32 -0
- package/src/login/types.ts +8 -0
- package/src/manager/README.md +1 -1
- package/tests/failure.spec.tsx +176 -0
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ legacy). The server-side counterpart is `@owlmeans/server-auth`.
|
|
|
12
12
|
## Installation
|
|
13
13
|
|
|
14
14
|
```bash
|
|
15
|
-
bun add @owlmeans/client-auth@^0.1.19
|
|
15
|
+
bun add @owlmeans/client-auth@^0.1.19
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
## Concepts
|
|
@@ -322,7 +322,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
|
|
|
322
322
|
your project's skill store (`.agents/skills/`):
|
|
323
323
|
|
|
324
324
|
```sh
|
|
325
|
-
npx @owlmeans/agent-skills@^0.1.19
|
|
325
|
+
npx @owlmeans/agent-skills@^0.1.19
|
|
326
326
|
```
|
|
327
327
|
|
|
328
328
|
The embedded files are version-matched to this package release. Do not edit them
|
package/agent-meta/manifest.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 3,
|
|
3
3
|
"package": "@owlmeans/client-auth",
|
|
4
|
-
"version": "0.1.19
|
|
5
|
-
"generatedAt": "2026-
|
|
4
|
+
"version": "0.1.19",
|
|
5
|
+
"generatedAt": "2026-11-01T22:22:22.274Z",
|
|
6
6
|
"canonicalRepo": "https://github.com/owlmeans/common",
|
|
7
7
|
"entries": [
|
|
8
8
|
{
|
|
@@ -24,6 +24,8 @@
|
|
|
24
24
|
"useLogin",
|
|
25
25
|
"@owlmeans/client-auth/login",
|
|
26
26
|
"useLogout",
|
|
27
|
+
"loginFailureHelper",
|
|
28
|
+
"LoginFailureView",
|
|
27
29
|
"appendLogin",
|
|
28
30
|
"loginTermsHelper",
|
|
29
31
|
"loginLandingOf",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: client-auth
|
|
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
|
|
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, the useLogin/useLogout hooks and the failed-sign-in reading (loginFailureHelper, LoginFailureView — a refusal vs a failure). Auto-invoked when importing client-auth helpers, registering an authentication plugin, wiring a sign-in control, or phrasing a failed sign-in.
|
|
4
4
|
user-invocable: false
|
|
5
5
|
---
|
|
6
6
|
<!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
|
|
@@ -8,7 +8,7 @@ user-invocable: false
|
|
|
8
8
|
# @owlmeans/client-auth
|
|
9
9
|
|
|
10
10
|
**Layer:** Client
|
|
11
|
-
**Install:** `"@owlmeans/client-auth": "^0.1.19
|
|
11
|
+
**Install:** `"@owlmeans/client-auth": "^0.1.19"` in `dependencies`
|
|
12
12
|
|
|
13
13
|
Five subpaths, five jobs:
|
|
14
14
|
|
|
@@ -63,6 +63,37 @@ setupExternalAuthentication(MY_WEB_SERVICE) // the service alias the provider
|
|
|
63
63
|
`@owlmeans/web-client`'s own `makeContext` already appends the auth service and the login host, so
|
|
64
64
|
a web application only calls these when it builds its context by hand.
|
|
65
65
|
|
|
66
|
+
## A failed sign-in (`./login`: `loginFailureHelper`, `LoginFailureView`)
|
|
67
|
+
|
|
68
|
+
Every sign-in surface — the dispatcher's token exchange, `FallbackLoginScreen`, the Google callback,
|
|
69
|
+
the supervisor form, `client-panel`'s login model — reads a caught error through ONE helper and
|
|
70
|
+
phrases it the same way:
|
|
71
|
+
|
|
72
|
+
| `loginFailureHelper.failureOf(error).kind` | When | Action offered |
|
|
73
|
+
|---|---|---|
|
|
74
|
+
| `account-disabled` | a visible code `authen:account:disabled` / `forbidden:account:disabled` | "Back to sign-in" |
|
|
75
|
+
| `profile-disabled` | a visible code `authen:profile:disabled` / `forbidden:profile:disabled` | "Back to sign-in" |
|
|
76
|
+
| `refused` | an `AuthRefused` of any module copy (by `type`), or a production 403 carrying `X-OwlMeans-Denial: access-denied` (`apiStatusHelper.isAccessDenied`, `@owlmeans/api/status`) | "Back to sign-in" |
|
|
77
|
+
| `failed` | anything else — a fault, a timeout, a 403 WITHOUT the marker (plan refusals use 403 too) | "Try again" + `Reference: <incident id>` when the server sent one |
|
|
78
|
+
|
|
79
|
+
- `refused` is `true` for every kind but `failed`; `isRefusal(error)` reads it. A refusal is the
|
|
80
|
+
person's condition: it carries no incident line, and a surface logs it at `warn`
|
|
81
|
+
(`auth.refused`), a failure at `error`.
|
|
82
|
+
- `phrase(failure, translate?)` → `{ message, incident, action }` over the `auth` library keys
|
|
83
|
+
`login.error.{refused,account-disabled,profile-disabled,failed,back,retry,incident}` (eight
|
|
84
|
+
languages, `src/login/i18n/*.json`), English without a translate. The incident id is filled into
|
|
85
|
+
`Reference: {{incident}}` AFTER translation, never as an i18next parameter. An app rewords a key
|
|
86
|
+
with an App-tier override of the `auth` resource.
|
|
87
|
+
- `makeAuthTranslate(cfg)` is that translate without React context (it drains the `auth` bundle
|
|
88
|
+
into the app's i18next instance), for a surface rendered outside any screen binding.
|
|
89
|
+
- `LoginFailureView({ failure, translate?, onAction?, page?, style? })` renders the end state with
|
|
90
|
+
raw elements and inline styles (any UI family); hooks `[data-login-failure="<kind>"]`,
|
|
91
|
+
`[data-login-refused]`, `[data-login-failure-message]`, `[data-login-failure-incident]`,
|
|
92
|
+
`[data-login-failure-action]`. The dispatcher renders it in place of its renderer when a supplied
|
|
93
|
+
token's exchange signs nobody in; its action is a restart (the token is single-use).
|
|
94
|
+
- A server refusing a sign-in for who the person is throws `AuthRefused` (`@owlmeans/auth`); this
|
|
95
|
+
helper is what turns it into a sentence instead of a retry loop.
|
|
96
|
+
|
|
66
97
|
## Rules
|
|
67
98
|
|
|
68
99
|
- An application's translated legal destinations are opt-in `login.terms.localizedHrefs`, keyed by
|
|
@@ -95,7 +126,9 @@ a web application only calls these when it builds its context by hand.
|
|
|
95
126
|
|
|
96
127
|
## Depends On
|
|
97
128
|
|
|
98
|
-
- `@owlmeans/auth`, `@owlmeans/auth-common` — types, aliases, `authMiddleware`
|
|
129
|
+
- `@owlmeans/auth`, `@owlmeans/auth-common` — types, aliases, `authMiddleware`, `AuthRefused`
|
|
130
|
+
- `@owlmeans/api` — `apiStatusHelper` (`./status`): the denial marker and the incident id of a failure
|
|
131
|
+
- `@owlmeans/client-i18n`, `@owlmeans/i18n` — the `auth` library resource `makeAuthTranslate` reads
|
|
99
132
|
- `@owlmeans/client`, `@owlmeans/client-context`, `@owlmeans/client-entrypoint`, `@owlmeans/client-socket`
|
|
100
133
|
- `@owlmeans/config` — the login screen, terms and credit configuration
|
|
101
134
|
- `@owlmeans/basic-envelope` — decoding the bearer envelope
|
|
@@ -3,7 +3,7 @@ name: login
|
|
|
3
3
|
description: The ./login host — method registry, post-login landing, the terms confirmation, surrogate windows, token adoption, and the useLogin/useLogout hooks.
|
|
4
4
|
metadata:
|
|
5
5
|
purposes: auth, consent
|
|
6
|
-
mentions: useLogin, @owlmeans/client-auth/login, useLogout, appendLogin, loginTermsHelper, loginLandingOf, loginTokenOf, loginStartOf, loginMethodsHelper, LoginStep, LoginPlugin, FallbackLoginScreen
|
|
6
|
+
mentions: useLogin, @owlmeans/client-auth/login, useLogout, loginFailureHelper, LoginFailureView, appendLogin, loginTermsHelper, loginLandingOf, loginTokenOf, loginStartOf, loginMethodsHelper, LoginStep, LoginPlugin, FallbackLoginScreen
|
|
7
7
|
---
|
|
8
8
|
<!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
|
|
9
9
|
|
|
@@ -31,6 +31,7 @@ browsing context the round trip can complete at all.
|
|
|
31
31
|
| `FallbackLoginScreen`, `LoginScreenProps` (now also carries `locale?: string`, for `Intl.ListFormat` and a custom document's locale-keyed label), `LoginScreenComponent` | The plain sign-in screen a relying party renders when no UI family registered one |
|
|
32
32
|
| `surrogatePath(ctx, target)`, `SurrogateTarget` | Where a surrogate login window opens; `null` on an older entrypoint list |
|
|
33
33
|
| `loginResumeHelper.resumeAction(outcome)`, `ResumeAction`, `loginResumeHelper.loginAttemptError(outcome)` | The one reading of a `resume` outcome, and the one reading of a finished attempt |
|
|
34
|
+
| `loginFailureHelper` → `.failureOf(error)`, `.isRefusal(error)`, `.phrase(failure, translate?)`; `LoginFailureView`; `LoginFailureKind`; `makeAuthTranslate(cfg)` | The one reading and phrasing of a failed sign-in — refusal vs failure (SKILL.md § A failed sign-in) |
|
|
34
35
|
| `registerNotifier(notifier)` (on `LoginService`), `LoginNotifier` | Surfaces a `begin`/`logout` outcome that has no inline screen to render it on — e.g. a toast on `LoginOutcome.Blocked` for a header "Log in"/"Log out" control. `web-panel`'s `appendLoginScreen` registers a default; unregistered, it is silence |
|
|
35
36
|
| `enterOidcAuthorization(model)` | Move a flow to the step that can authorize — idempotent, call it before every `authenticate` |
|
|
36
37
|
| `loginTokenOf(ctx).adoptToken(token)`, `.revokeToken()` | The single adoption and de-adoption paths |
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/components/dispatcher/component.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAA2B,cAAc,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/components/dispatcher/component.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAA2B,cAAc,EAAE,MAAM,YAAY,CAAA;AAqBzE,eAAO,MAAM,aAAa,EAAE,cA2I3B,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback, useEffect, useState } from 'react';
|
|
2
|
+
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
3
3
|
import { AUTH_QUERY, DISPATCHER } from '@owlmeans/auth';
|
|
4
4
|
import { HOME } from '@owlmeans/context';
|
|
5
5
|
import { DEFAULT_ALIAS, DEFAULT_ENTITY } from '../../consts.js';
|
|
@@ -8,11 +8,46 @@ import { DEFAULT_ALIAS as FLOW_SERVICE } from '@owlmeans/client-flow';
|
|
|
8
8
|
import { FLOW_PLACEHOLDER, OidcAuthStep, STD_OIDC_FLOW } from '@owlmeans/flow';
|
|
9
9
|
import { SERVICE_PARAM } from '@owlmeans/web-flow';
|
|
10
10
|
import { loginLandingOf } from '../../login/land.js';
|
|
11
|
+
import { loginFailureHelper } from '../../login/failure.js';
|
|
12
|
+
import { LoginFailureView } from '../../login/failure-view.js';
|
|
13
|
+
import { makeAuthTranslate } from '../../login/translate.js';
|
|
14
|
+
import { ensureLoginService } from '../../login/service.js';
|
|
11
15
|
import { logger } from '@owlmeans/log';
|
|
12
16
|
const log = logger('client-auth:dispatcher');
|
|
13
17
|
export const DispatcherHOC = Renderer => ({ context, params, alias, query, payload }) => {
|
|
14
18
|
const [forwarding, setForwarding] = useState();
|
|
19
|
+
// How the exchange of a supplied token ended, when it did not sign anyone in. Rendered here, in
|
|
20
|
+
// place of the renderer, so no renderer is left on its "loading" line forever.
|
|
21
|
+
const [failure, setFailure] = useState(null);
|
|
15
22
|
const navigator = useNavigate();
|
|
23
|
+
const fail = useCallback((error) => {
|
|
24
|
+
const failed = loginFailureHelper.failureOf(error);
|
|
25
|
+
if (failed.refused) {
|
|
26
|
+
// The person's condition, not a fault: the server said so on purpose.
|
|
27
|
+
log.warn('Sign-in refused', { kind: failed.kind, incidentId: failed.incidentId }, { event: 'auth.refused' });
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
log.error('Authentication failed', error, { event: 'auth.refused' });
|
|
31
|
+
}
|
|
32
|
+
setFailure(failed);
|
|
33
|
+
}, []);
|
|
34
|
+
// Back to the start of signing in — the dispatcher with nothing to exchange. A supplied token is
|
|
35
|
+
// single-use, so sending it again could only fail again. A full load where there is a document,
|
|
36
|
+
// so the renderer starts from scratch; an in-app hop elsewhere.
|
|
37
|
+
const restart = useCallback(() => {
|
|
38
|
+
void (async () => {
|
|
39
|
+
if (ensureLoginService(context).env().hasWindow) {
|
|
40
|
+
window.location.replace(await loginLandingOf(context).landingUrl({ alias: DISPATCHER }));
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
setFailure(null);
|
|
44
|
+
setForwarding(undefined);
|
|
45
|
+
await navigator.navigate(context.entrypoint(DISPATCHER), { params: {}, query: {} });
|
|
46
|
+
})().catch((error) => {
|
|
47
|
+
log.warn('The sign-in screen could not be reopened', error);
|
|
48
|
+
});
|
|
49
|
+
}, []);
|
|
50
|
+
const translate = useMemo(() => failure != null ? makeAuthTranslate(context.cfg) : undefined, [failure]);
|
|
16
51
|
const navigate = useCallback(async () => {
|
|
17
52
|
if (alias == null || alias === DISPATCHER) {
|
|
18
53
|
// A sign-in that started elsewhere — a device or authorization-code consent screen, most
|
|
@@ -83,15 +118,16 @@ export const DispatcherHOC = Renderer => ({ context, params, alias, query, paylo
|
|
|
83
118
|
}
|
|
84
119
|
}
|
|
85
120
|
await flow.proceed();
|
|
86
|
-
});
|
|
121
|
+
}).catch(fail);
|
|
87
122
|
}
|
|
88
123
|
else {
|
|
89
124
|
const auth = context.service(DEFAULT_ALIAS);
|
|
125
|
+
// A refused or failed exchange ends in the failure view; a navigation that fails after a
|
|
126
|
+
// successful one is only logged — the person IS signed in by then.
|
|
90
127
|
auth.authenticate(forwarding.token).then(async () => {
|
|
91
128
|
return await navigate();
|
|
92
|
-
}).catch((e) => {
|
|
93
|
-
|
|
94
|
-
log.error('Authentication failed', e, { event: 'auth.refused' });
|
|
129
|
+
}, fail).catch((e) => {
|
|
130
|
+
log.error('Navigation after sign-in failed', e);
|
|
95
131
|
});
|
|
96
132
|
}
|
|
97
133
|
}
|
|
@@ -99,6 +135,9 @@ export const DispatcherHOC = Renderer => ({ context, params, alias, query, paylo
|
|
|
99
135
|
const provideToken = useCallback((token, query) => {
|
|
100
136
|
setForwarding({ token, query });
|
|
101
137
|
}, []);
|
|
138
|
+
if (failure != null) {
|
|
139
|
+
return _jsx(LoginFailureView, { failure: failure, translate: translate, onAction: restart, page: true });
|
|
140
|
+
}
|
|
102
141
|
return _jsx(Renderer, { provideToken: provideToken, navigate: navigate });
|
|
103
142
|
};
|
|
104
143
|
//# sourceMappingURL=component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../src/components/dispatcher/component.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW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AAK,CAAC,IAAI,CAAC,CAAA;YAChB,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAc,aAAa,CAAC,CAAA;gBACxD,yFAAyF;gBACzF,mEAAmE;gBACnE,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE;oBAClD,OAAO,MAAM,QAAQ,EAAE,CAAA;gBACzB,CAAC,EAAE,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAU,EAAE,EAAE;oBAC5B,GAAG,CAAC,KAAK,CAAC,iCAAiC,EAAE,CAAC,CAAC,CAAA;gBACjD,CAAC,CAAC,CAAA;YACJ,CAAC;QACH,CAAC;IACH,CAAC,EAAE,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC,CAAA;IAEvB,MAAM,YAAY,GAAG,WAAW,CAA0C,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;QACzF,aAAa,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAA;IACjC,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;QACpB,OAAO,KAAC,gBAAgB,IAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,SAAG,CAAA;IAC7F,CAAC;IAED,OAAO,KAAC,QAAQ,IAAC,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,GAAI,CAAA;AACrE,CAAC,CAAA"}
|
package/build/entrypoints.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
/** Browser entrypoints for the authentication protocols every client may call. */
|
|
2
|
-
export declare const entrypoints: import("@owlmeans/client-entrypoint").ClientProtocolEntrypoint<
|
|
3
|
-
body: import("@owlmeans/auth").AuthToken;
|
|
4
|
-
}, import("@owlmeans/auth").AuthToken>>[];
|
|
2
|
+
export declare const entrypoints: import("@owlmeans/client-entrypoint").ClientProtocolEntrypoint<any>[];
|
|
5
3
|
/** Bind the external-authentication screen to one explicitly selected service. */
|
|
6
|
-
export declare const bindExternalAuthentication: (service: string) => import("@owlmeans/client-entrypoint").ClientProtocolEntrypoint<
|
|
4
|
+
export declare const bindExternalAuthentication: (service: string) => import("@owlmeans/client-entrypoint").ClientProtocolEntrypoint<any>;
|
|
7
5
|
//# sourceMappingURL=entrypoints.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entrypoints.d.ts","sourceRoot":"","sources":["../src/entrypoints.ts"],"names":[],"mappings":"AAIA,kFAAkF;AAClF,eAAO,MAAM,WAAW
|
|
1
|
+
{"version":3,"file":"entrypoints.d.ts","sourceRoot":"","sources":["../src/entrypoints.ts"],"names":[],"mappings":"AAIA,kFAAkF;AAClF,eAAO,MAAM,WAAW,uEAA+C,CAAA;AAEvE,kFAAkF;AAClF,eAAO,MAAM,0BAA0B,YAAa,MAAM,wEAC+B,CAAA"}
|
|
@@ -9,6 +9,10 @@ import type { CSSProperties } from 'react';
|
|
|
9
9
|
*/
|
|
10
10
|
export declare const page: CSSProperties;
|
|
11
11
|
export declare const box: CSSProperties;
|
|
12
|
+
/** The one action of a failed sign-in — the way back, or the retry. */
|
|
13
|
+
export declare const failureAction: CSSProperties;
|
|
14
|
+
/** The library resource the sign-in copy is registered in (`i18n.ts`), in the `lib` namespace. */
|
|
15
|
+
export declare const LOGIN_I18N_RESOURCE = "auth";
|
|
12
16
|
/** The same English fallback a document's `i18nKey` translates to when nothing else names it. */
|
|
13
17
|
export declare const DEFAULT_LABEL: Record<string, string>;
|
|
14
18
|
/** Outcomes after which nobody was signed in, so a screen parked for the landing must not wait. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consts.local.d.ts","sourceRoot":"","sources":["../../src/login/consts.local.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAE1C;;;;;;GAMG;AACH,eAAO,MAAM,IAAI,EAAE,aAIlB,CAAA;AAGD,eAAO,MAAM,GAAG,EAAE,aAEjB,CAAA;AAED,iGAAiG;AACjG,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAMhD,CAAA;AAED,mGAAmG;AACnG,eAAO,MAAM,iBAAiB,EAAE,WAAW,CAAC,YAAY,CAEtD,CAAA"}
|
|
1
|
+
{"version":3,"file":"consts.local.d.ts","sourceRoot":"","sources":["../../src/login/consts.local.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAE1C;;;;;;GAMG;AACH,eAAO,MAAM,IAAI,EAAE,aAIlB,CAAA;AAGD,eAAO,MAAM,GAAG,EAAE,aAEjB,CAAA;AAED,uEAAuE;AACvE,eAAO,MAAM,aAAa,EAAE,aAI3B,CAAA;AAED,kGAAkG;AAClG,eAAO,MAAM,mBAAmB,SAAS,CAAA;AAEzC,iGAAiG;AACjG,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAMhD,CAAA;AAED,mGAAmG;AACnG,eAAO,MAAM,iBAAiB,EAAE,WAAW,CAAC,YAAY,CAEtD,CAAA"}
|
|
@@ -15,6 +15,14 @@ export const page = {
|
|
|
15
15
|
export const box = {
|
|
16
16
|
width: '100%', maxWidth: '24rem', padding: '1.5rem', textAlign: 'center',
|
|
17
17
|
};
|
|
18
|
+
/** The one action of a failed sign-in — the way back, or the retry. */
|
|
19
|
+
export const failureAction = {
|
|
20
|
+
display: 'inline-block', marginTop: '1rem', padding: '.625rem 1rem', fontSize: '1rem',
|
|
21
|
+
cursor: 'pointer', borderRadius: '.375rem', border: '1px solid currentColor', background: 'transparent',
|
|
22
|
+
color: 'inherit',
|
|
23
|
+
};
|
|
24
|
+
/** The library resource the sign-in copy is registered in (`i18n.ts`), in the `lib` namespace. */
|
|
25
|
+
export const LOGIN_I18N_RESOURCE = 'auth';
|
|
18
26
|
/** The same English fallback a document's `i18nKey` translates to when nothing else names it. */
|
|
19
27
|
export const DEFAULT_LABEL = {
|
|
20
28
|
terms: 'Terms & Conditions',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consts.local.js","sourceRoot":"","sources":["../../src/login/consts.local.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAG1C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,IAAI,GAAkB;IACjC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc,EAAE,QAAQ;IAC/D,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM;IACpC,UAAU,EAAE,uBAAuB,EAAE,UAAU,EAAE,GAAG;CACrD,CAAA;AAED,gFAAgF;AAChF,MAAM,CAAC,MAAM,GAAG,GAAkB;IAChC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ;CACzE,CAAA;AAED,iGAAiG;AACjG,MAAM,CAAC,MAAM,aAAa,GAA2B;IACnD,KAAK,EAAE,oBAAoB;IAC3B,OAAO,EAAE,gBAAgB;IACzB,OAAO,EAAE,eAAe;IACxB,OAAO,EAAE,eAAe;IACxB,OAAO,EAAE,2BAA2B;CACrC,CAAA;AAED,mGAAmG;AACnG,MAAM,CAAC,MAAM,iBAAiB,GAA8B,IAAI,GAAG,CAAe;IAChF,YAAY,CAAC,OAAO,EAAE,YAAY,CAAC,MAAM,EAAE,YAAY,CAAC,OAAO;CAChE,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"consts.local.js","sourceRoot":"","sources":["../../src/login/consts.local.ts"],"names":[],"mappings":"AAAA,OAAO,EA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
*
|
|
4
|
+
* Every kind but {@link LoginFailureKind.Failed} is a refusal of THIS account: trying again with it
|
|
5
|
+
* changes nothing, so a screen offers the way back to the sign-in choice instead of a retry.
|
|
6
|
+
*/
|
|
7
|
+
export declare enum LoginFailureKind {
|
|
8
|
+
/** The server refused this account here (403 with the access-denied marker, or `AuthRefused`). */
|
|
9
|
+
Refused = "refused",
|
|
10
|
+
/** The account is banned — the refusal code `account:disabled` was visible. */
|
|
11
|
+
AccountDisabled = "account-disabled",
|
|
12
|
+
/** The account's access to this application is blocked — `profile:disabled` was visible. */
|
|
13
|
+
ProfileDisabled = "profile-disabled",
|
|
14
|
+
/** Anything else: a fault, a timeout, a network error, an expired attempt. Worth a retry. */
|
|
15
|
+
Failed = "failed"
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=consts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../../src/login/failure/consts.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,oBAAY,gBAAgB;IAC1B,kGAAkG;IAClG,OAAO,YAAY;IACnB,+EAA+E;IAC/E,eAAe,qBAAqB;IACpC,4FAA4F;IAC5F,eAAe,qBAAqB;IACpC,6FAA6F;IAC7F,MAAM,WAAW;CAClB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a failed sign-in means for the person looking at it.
|
|
3
|
+
*
|
|
4
|
+
* Every kind but {@link LoginFailureKind.Failed} is a refusal of THIS account: trying again with it
|
|
5
|
+
* changes nothing, so a screen offers the way back to the sign-in choice instead of a retry.
|
|
6
|
+
*/
|
|
7
|
+
export var LoginFailureKind;
|
|
8
|
+
(function (LoginFailureKind) {
|
|
9
|
+
/** The server refused this account here (403 with the access-denied marker, or `AuthRefused`). */
|
|
10
|
+
LoginFailureKind["Refused"] = "refused";
|
|
11
|
+
/** The account is banned — the refusal code `account:disabled` was visible. */
|
|
12
|
+
LoginFailureKind["AccountDisabled"] = "account-disabled";
|
|
13
|
+
/** The account's access to this application is blocked — `profile:disabled` was visible. */
|
|
14
|
+
LoginFailureKind["ProfileDisabled"] = "profile-disabled";
|
|
15
|
+
/** Anything else: a fault, a timeout, a network error, an expired attempt. Worth a retry. */
|
|
16
|
+
LoginFailureKind["Failed"] = "failed";
|
|
17
|
+
})(LoginFailureKind || (LoginFailureKind = {}));
|
|
18
|
+
//# sourceMappingURL=consts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.js","sourceRoot":"","sources":["../../../src/login/failure/consts.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAN,IAAY,gBASX;AATD,WAAY,gBAAgB;IAC1B,kGAAkG;IAClG,uCAAmB,CAAA;IACnB,+EAA+E;IAC/E,wDAAoC,CAAA;IACpC,4FAA4F;IAC5F,wDAAoC,CAAA;IACpC,6FAA6F;IAC7F,qCAAiB,CAAA;AACnB,CAAC,EATW,gBAAgB,KAAhB,gBAAgB,QAS3B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { LoginFailureKind } from './consts.js';
|
|
2
|
+
/** The `auth` library key and English fallback phrasing each kind (`login.error.<kind>`). */
|
|
3
|
+
export declare const FAILURE_COPY: Readonly<Record<LoginFailureKind, readonly [string, string]>>;
|
|
4
|
+
/** The action of a refusal: back to the choice of how to sign in. */
|
|
5
|
+
export declare const BACK_COPY: readonly [string, string];
|
|
6
|
+
/** The action of any other failure: the same attempt once more. */
|
|
7
|
+
export declare const RETRY_COPY: readonly [string, string];
|
|
8
|
+
/** The incident id a person can report — filled AFTER translation, never as an i18next parameter. */
|
|
9
|
+
export declare const INCIDENT_COPY: readonly [string, string];
|
|
10
|
+
export declare const INCIDENT_PLACEHOLDER = "{{incident}}";
|
|
11
|
+
/**
|
|
12
|
+
* A refusal code, wherever a message exposes it: the identity store's sign-in refusal
|
|
13
|
+
* (`auth:manager:authen:<code>`, `AuthRefused` and the `AuthenFailed` it extends) and the integrated
|
|
14
|
+
* IAM finalizer's (`auth:authorization:forbidden:<code>`). The lookahead keeps `…:disabled-x` out.
|
|
15
|
+
*/
|
|
16
|
+
export declare const REFUSAL_CODES: ReadonlyArray<readonly [RegExp, LoginFailureKind]>;
|
|
17
|
+
//# sourceMappingURL=consts.local.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.local.d.ts","sourceRoot":"","sources":["../../../src/login/failure/consts.local.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAE9C,6FAA6F;AAC7F,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,gBAAgB,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAUrF,CAAA;AAEF,qEAAqE;AACrE,eAAO,MAAM,SAAS,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAmE,CAAA;AAEnH,mEAAmE;AACnE,eAAO,MAAM,UAAU,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAA8D,CAAA;AAE/G,qGAAqG;AACrG,eAAO,MAAM,aAAa,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAA+E,CAAA;AAEnI,eAAO,MAAM,oBAAoB,iBAAiB,CAAA;AAElD;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,aAAa,CAAC,SAAS,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAGlE,CAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { LoginFailureKind } from './consts.js';
|
|
2
|
+
/** The `auth` library key and English fallback phrasing each kind (`login.error.<kind>`). */
|
|
3
|
+
export const FAILURE_COPY = Object.freeze({
|
|
4
|
+
[LoginFailureKind.Refused]: ['login.error.refused', 'This account cannot sign in here.'],
|
|
5
|
+
[LoginFailureKind.AccountDisabled]: [
|
|
6
|
+
'login.error.account-disabled', 'This account has been disabled and cannot sign in here.',
|
|
7
|
+
],
|
|
8
|
+
[LoginFailureKind.ProfileDisabled]: [
|
|
9
|
+
'login.error.profile-disabled',
|
|
10
|
+
'This account’s access to this application has been blocked, so it cannot sign in here.',
|
|
11
|
+
],
|
|
12
|
+
[LoginFailureKind.Failed]: ['login.error.failed', 'Sign-in did not complete. Please try again.'],
|
|
13
|
+
});
|
|
14
|
+
/** The action of a refusal: back to the choice of how to sign in. */
|
|
15
|
+
export const BACK_COPY = Object.freeze(['login.error.back', 'Back to sign-in']);
|
|
16
|
+
/** The action of any other failure: the same attempt once more. */
|
|
17
|
+
export const RETRY_COPY = Object.freeze(['login.error.retry', 'Try again']);
|
|
18
|
+
/** The incident id a person can report — filled AFTER translation, never as an i18next parameter. */
|
|
19
|
+
export const INCIDENT_COPY = Object.freeze(['login.error.incident', 'Reference: {{incident}}']);
|
|
20
|
+
export const INCIDENT_PLACEHOLDER = '{{incident}}';
|
|
21
|
+
/**
|
|
22
|
+
* A refusal code, wherever a message exposes it: the identity store's sign-in refusal
|
|
23
|
+
* (`auth:manager:authen:<code>`, `AuthRefused` and the `AuthenFailed` it extends) and the integrated
|
|
24
|
+
* IAM finalizer's (`auth:authorization:forbidden:<code>`). The lookahead keeps `…:disabled-x` out.
|
|
25
|
+
*/
|
|
26
|
+
export const REFUSAL_CODES = Object.freeze([
|
|
27
|
+
[/(?:authen|forbidden):account:disabled(?![\w-])/, LoginFailureKind.AccountDisabled],
|
|
28
|
+
[/(?:authen|forbidden):profile:disabled(?![\w-])/, LoginFailureKind.ProfileDisabled],
|
|
29
|
+
]);
|
|
30
|
+
//# sourceMappingURL=consts.local.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.local.js","sourceRoot":"","sources":["../../../src/login/failure/consts.local.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAE9C,6FAA6F;AAC7F,MAAM,CAAC,MAAM,YAAY,GAAkE,MAAM,CAAC,MAAM,CAAC;IACvG,CAAC,gBAAgB,CAAC,OAAO,CAAC,EAAE,CAAC,qBAAqB,EAAE,mCAAmC,CAAC;IACxF,CAAC,gBAAgB,CAAC,eAAe,CAAC,EAAE;QAClC,8BAA8B,EAAE,yDAAyD;KAC1F;IACD,CAAC,gBAAgB,CAAC,eAAe,CAAC,EAAE;QAClC,8BAA8B;QAC9B,wFAAwF;KACzF;IACD,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAAE,CAAC,oBAAoB,EAAE,6CAA6C,CAAC;CACjG,CAAC,CAAA;AAEF,qEAAqE;AACrE,MAAM,CAAC,MAAM,SAAS,GAA8B,MAAM,CAAC,MAAM,CAAC,CAAC,kBAAkB,EAAE,iBAAiB,CAAU,CAAC,CAAA;AAEnH,mEAAmE;AACnE,MAAM,CAAC,MAAM,UAAU,GAA8B,MAAM,CAAC,MAAM,CAAC,CAAC,mBAAmB,EAAE,WAAW,CAAU,CAAC,CAAA;AAE/G,qGAAqG;AACrG,MAAM,CAAC,MAAM,aAAa,GAA8B,MAAM,CAAC,MAAM,CAAC,CAAC,sBAAsB,EAAE,yBAAyB,CAAU,CAAC,CAAA;AAEnI,MAAM,CAAC,MAAM,oBAAoB,GAAG,cAAc,CAAA;AAElD;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAuD,MAAM,CAAC,MAAM,CAAC;IAC7F,CAAC,gDAAgD,EAAE,gBAAgB,CAAC,eAAe,CAAC;IACpF,CAAC,gDAAgD,EAAE,gBAAgB,CAAC,eAAe,CAAC;CAC5E,CAAC,CAAA"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
import type { LoginFailureKind } from './consts.js';
|
|
3
|
+
import type { LoginTranslate } from '../types.js';
|
|
4
|
+
/** A failed sign-in, read for the person who has to act on it. */
|
|
5
|
+
export interface LoginFailure {
|
|
6
|
+
kind: LoginFailureKind;
|
|
7
|
+
/** A refusal of this account — retrying with it changes nothing. */
|
|
8
|
+
refused: boolean;
|
|
9
|
+
/** The `auth` library key that phrases it (`login.error.<kind>`); an app overrides it there. */
|
|
10
|
+
key: string;
|
|
11
|
+
/** The English sentence used when no translation resolves the key. */
|
|
12
|
+
fallback: string;
|
|
13
|
+
/** The server's incident id, when it sent one — what a person reports for a failure. */
|
|
14
|
+
incidentId: string | null;
|
|
15
|
+
}
|
|
16
|
+
/** The three lines a failure view renders, already translated. */
|
|
17
|
+
export interface LoginFailurePhrase {
|
|
18
|
+
message: string;
|
|
19
|
+
/** `Reference: <id>` for a failure that is not a refusal and carries an incident id. */
|
|
20
|
+
incident: string | null;
|
|
21
|
+
/** The action's label: "Back to sign-in" for a refusal, "Try again" otherwise. */
|
|
22
|
+
action: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* How every OwlMeans sign-in surface reads a failed attempt — the Google callback, the supervisor
|
|
26
|
+
* form, the dispatcher's exchange and the sign-in screens — so they phrase it the same way.
|
|
27
|
+
*/
|
|
28
|
+
export interface LoginFailureHelper {
|
|
29
|
+
/**
|
|
30
|
+
* What a caught sign-in error means.
|
|
31
|
+
*
|
|
32
|
+
* A visible refusal code comes first (`account:disabled`, `profile:disabled` — a development body
|
|
33
|
+
* rebuilt into its class, or a message that names it); then a refusal without one: an
|
|
34
|
+
* `AuthRefused` of any module copy, or the production answer `apiStatusHelper.isAccessDenied`
|
|
35
|
+
* recognises (403 with `X-OwlMeans-Denial: access-denied`). Anything else — a 403 without the
|
|
36
|
+
* marker included, since plan and entitlement refusals use that status too — is `Failed`.
|
|
37
|
+
*/
|
|
38
|
+
failureOf: (error: unknown) => LoginFailure;
|
|
39
|
+
/** `failureOf(error).refused`. */
|
|
40
|
+
isRefusal: (error: unknown) => boolean;
|
|
41
|
+
/** The failure's sentences through `translate` (the `auth` library keys), English without one. */
|
|
42
|
+
phrase: (failure: LoginFailure, translate?: LoginTranslate) => LoginFailurePhrase;
|
|
43
|
+
}
|
|
44
|
+
export interface LoginFailureViewProps {
|
|
45
|
+
failure: LoginFailure;
|
|
46
|
+
/** `(key, defaultValue) => string` over the `auth` library — a prop, never an implicit i18n read. */
|
|
47
|
+
translate?: LoginTranslate;
|
|
48
|
+
/**
|
|
49
|
+
* What the action button does — the way back to the sign-in choice for a refusal, the same
|
|
50
|
+
* attempt again otherwise. Omitted, no button is rendered.
|
|
51
|
+
*/
|
|
52
|
+
onAction?: () => void;
|
|
53
|
+
/** Wrap the notice in the centred full-viewport page of the plain sign-in screen. */
|
|
54
|
+
page?: boolean;
|
|
55
|
+
style?: CSSProperties;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/login/failure/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEjD,kEAAkE;AAClE,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,gBAAgB,CAAA;IACtB,oEAAoE;IACpE,OAAO,EAAE,OAAO,CAAA;IAChB,gGAAgG;IAChG,GAAG,EAAE,MAAM,CAAA;IACX,sEAAsE;IACtE,QAAQ,EAAE,MAAM,CAAA;IAChB,wFAAwF;IACxF,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;CAC1B;AAED,kEAAkE;AAClE,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAA;IACf,wFAAwF;IACxF,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,kFAAkF;IAClF,MAAM,EAAE,MAAM,CAAA;CACf;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;;;;;;OAQG;IACH,SAAS,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,YAAY,CAAA;IAC3C,kCAAkC;IAClC,SAAS,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAA;IACtC,kGAAkG;IAClG,MAAM,EAAE,CAAC,OAAO,EAAE,YAAY,EAAE,SAAS,CAAC,EAAE,cAAc,KAAK,kBAAkB,CAAA;CAClF;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,YAAY,CAAA;IACrB,qGAAqG;IACrG,SAAS,CAAC,EAAE,cAAc,CAAA;IAC1B;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;IACrB,qFAAqF;IACrF,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,KAAK,CAAC,EAAE,aAAa,CAAA;CACtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/login/failure/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import type { LoginFailureViewProps } from './failure/types.js';
|
|
3
|
+
/**
|
|
4
|
+
* The end state of a sign-in that did not complete: one phrased sentence, the incident reference of
|
|
5
|
+
* a failure, and the way on — back to the sign-in choice for a refusal, the same attempt again
|
|
6
|
+
* otherwise.
|
|
7
|
+
*
|
|
8
|
+
* Plain like `FallbackLoginScreen` — raw elements, inline styles, no class a consumer's stylesheet
|
|
9
|
+
* must scan for — so any OwlMeans surface can end on it, whatever UI family it belongs to. Hooks for
|
|
10
|
+
* tests and styling: `[data-login-failure="<kind>"]`, `[data-login-failure-message]`,
|
|
11
|
+
* `[data-login-failure-incident]`, `[data-login-failure-action]`.
|
|
12
|
+
*/
|
|
13
|
+
export declare const LoginFailureView: FC<LoginFailureViewProps>;
|
|
14
|
+
//# sourceMappingURL=failure-view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"failure-view.d.ts","sourceRoot":"","sources":["../../src/login/failure-view.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAG/B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAE/D;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CAmBtD,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { loginFailureHelper } from './failure.js';
|
|
3
|
+
import { box, failureAction, page } from './consts.local.js';
|
|
4
|
+
/**
|
|
5
|
+
* The end state of a sign-in that did not complete: one phrased sentence, the incident reference of
|
|
6
|
+
* a failure, and the way on — back to the sign-in choice for a refusal, the same attempt again
|
|
7
|
+
* otherwise.
|
|
8
|
+
*
|
|
9
|
+
* Plain like `FallbackLoginScreen` — raw elements, inline styles, no class a consumer's stylesheet
|
|
10
|
+
* must scan for — so any OwlMeans surface can end on it, whatever UI family it belongs to. Hooks for
|
|
11
|
+
* tests and styling: `[data-login-failure="<kind>"]`, `[data-login-failure-message]`,
|
|
12
|
+
* `[data-login-failure-incident]`, `[data-login-failure-action]`.
|
|
13
|
+
*/
|
|
14
|
+
export const LoginFailureView = ({ failure, translate, onAction, page: full, style }) => {
|
|
15
|
+
const phrase = loginFailureHelper.phrase(failure, translate);
|
|
16
|
+
const notice = _jsxs("div", { role: "alert", "data-login-failure": failure.kind, "data-login-refused": failure.refused ? 'true' : undefined, style: { ...box, ...style }, children: [_jsx("p", { "data-login-failure-message": true, style: { margin: 0 }, children: phrase.message }), phrase.incident != null && _jsx("p", { "data-login-failure-incident": true, style: { marginTop: '.5rem', fontSize: '.75rem', opacity: .7 }, children: phrase.incident }), onAction != null && _jsx("button", { type: "button", "data-login-failure-action": true, style: failureAction, onClick: onAction, children: phrase.action })] });
|
|
17
|
+
return full === true ? _jsx("div", { "data-login-failure-page": true, style: page, children: notice }) : notice;
|
|
18
|
+
};
|
|
19
|
+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;AAC1F,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"failure.d.ts","sourceRoot":"","sources":["../../src/login/failure.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAgB,kBAAkB,EAAsB,MAAM,oBAAoB,CAAA;AAG9F,eAAO,MAAM,wBAAwB,QAAO,kBAuD3C,CAAA;AAED,eAAO,MAAM,kBAAkB,oBAA6B,CAAA"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { AuthRefused } from '@owlmeans/auth';
|
|
2
|
+
import { apiStatusHelper } from '@owlmeans/api/status';
|
|
3
|
+
import { LoginFailureKind } from './failure/consts.js';
|
|
4
|
+
import { BACK_COPY, FAILURE_COPY, INCIDENT_COPY, INCIDENT_PLACEHOLDER, REFUSAL_CODES, RETRY_COPY, } from './failure/consts.local.js';
|
|
5
|
+
export const createLoginFailureHelper = () => {
|
|
6
|
+
const english = (_key, defaultValue) => defaultValue;
|
|
7
|
+
/** The message and type a caught value carries — a non-object carries none. */
|
|
8
|
+
const textOf = (error) => {
|
|
9
|
+
if (error == null || typeof error !== 'object') {
|
|
10
|
+
return typeof error === 'string' ? error : '';
|
|
11
|
+
}
|
|
12
|
+
const { message, type } = error;
|
|
13
|
+
return [message, type].filter((part) => typeof part === 'string').join(' ');
|
|
14
|
+
};
|
|
15
|
+
const codeOf = (error) => {
|
|
16
|
+
const text = textOf(error);
|
|
17
|
+
return REFUSAL_CODES.find(([marker]) => marker.test(text))?.[1] ?? null;
|
|
18
|
+
};
|
|
19
|
+
/** `AuthRefused` of this or another module copy: `instanceof` answers across copies by type name. */
|
|
20
|
+
const isRefusedClass = (error) => error instanceof AuthRefused
|
|
21
|
+
|| (error != null && typeof error === 'object' && error.type === AuthRefused.typeName);
|
|
22
|
+
const failureOf = (error) => {
|
|
23
|
+
const kind = codeOf(error)
|
|
24
|
+
?? (isRefusedClass(error) || apiStatusHelper.isAccessDenied(error) ? LoginFailureKind.Refused : LoginFailureKind.Failed);
|
|
25
|
+
const [key, fallback] = FAILURE_COPY[kind];
|
|
26
|
+
return {
|
|
27
|
+
kind,
|
|
28
|
+
refused: kind !== LoginFailureKind.Failed,
|
|
29
|
+
key,
|
|
30
|
+
fallback,
|
|
31
|
+
incidentId: apiStatusHelper.incidentIdOf(error),
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
const isRefusal = (error) => failureOf(error).refused;
|
|
35
|
+
const phrase = (failure, translate = english) => {
|
|
36
|
+
const [actionKey, actionFallback] = failure.refused ? BACK_COPY : RETRY_COPY;
|
|
37
|
+
// A refusal is the person's condition, not an incident to report: no reference line.
|
|
38
|
+
const incident = !failure.refused && failure.incidentId != null
|
|
39
|
+
? translate(INCIDENT_COPY[0], INCIDENT_COPY[1]).split(INCIDENT_PLACEHOLDER).join(failure.incidentId)
|
|
40
|
+
: null;
|
|
41
|
+
return {
|
|
42
|
+
message: translate(failure.key, failure.fallback),
|
|
43
|
+
incident,
|
|
44
|
+
action: translate(actionKey, actionFallback),
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
return { failureOf, isRefusal, phrase };
|
|
48
|
+
};
|
|
49
|
+
export const loginFailureHelper = createLoginFailureHelper();
|
|
50
|
+
//# sourceMappingURL=failure.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"failure.js","sourceRoot":"","sources":["../../src/login/failure.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EACL,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,oBAAoB,EAAE,aAAa,EAAE,UAAU,GACxF,MAAM,2BAA2B,CAAA;AAIlC,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAuB,EAAE;IAC/D,MAAM,OAAO,GAAmB,C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"}
|
package/build/login/i18n/be.json
CHANGED
|
@@ -34,7 +34,13 @@
|
|
|
34
34
|
},
|
|
35
35
|
"error": {
|
|
36
36
|
"failed": "Уваход не завершаны. Паспрабуйце яшчэ раз.",
|
|
37
|
-
"blocked": "Акно ўваходу заблакавана. Націсніце значок заблакаванага ўсплывальнага акна ў адрасным радку браўзера, каб адкрыць яго."
|
|
37
|
+
"blocked": "Акно ўваходу заблакавана. Націсніце значок заблакаванага ўсплывальнага акна ў адрасным радку браўзера, каб адкрыць яго.",
|
|
38
|
+
"refused": "З гэтым акаўнтам тут увайсці нельга.",
|
|
39
|
+
"account-disabled": "Гэты акаўнт адключаны, таму ўвайсці з ім тут нельга.",
|
|
40
|
+
"profile-disabled": "Доступ гэтага акаўнта да праграмы заблакаваны, таму ўвайсці з ім тут нельга.",
|
|
41
|
+
"retry": "Паспрабаваць зноў",
|
|
42
|
+
"back": "Вярнуцца да ўваходу",
|
|
43
|
+
"incident": "Код звароту: {{incident}}"
|
|
38
44
|
},
|
|
39
45
|
"orphaned": "Уваход выкананы. Можаце закрыць гэтае акно і вярнуцца ў праграму."
|
|
40
46
|
}
|