@owlmeans/client-auth 0.1.18-rc.57 → 0.1.18-rc.59
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 +21 -20
- package/agent-meta/manifest.json +2 -2
- package/agent-meta/skills/client-auth/SKILL.md +48 -28
- package/build/components/dispatcher/component.js +3 -3
- package/build/components/dispatcher/component.js.map +1 -1
- package/build/entrypoints.d.ts +4 -2
- package/build/entrypoints.d.ts.map +1 -1
- package/build/helper.d.ts.map +1 -1
- package/build/helper.js +2 -2
- package/build/helper.js.map +1 -1
- package/build/login/adopt/types.d.ts +26 -0
- package/build/login/adopt/types.d.ts.map +1 -0
- package/build/login/adopt/types.js +2 -0
- package/build/login/adopt/types.js.map +1 -0
- package/build/login/adopt.d.ts +6 -20
- package/build/login/adopt.d.ts.map +1 -1
- package/build/login/adopt.js +15 -25
- package/build/login/adopt.js.map +1 -1
- package/build/login/consts.d.ts +6 -0
- package/build/login/consts.d.ts.map +1 -1
- package/build/login/consts.js +6 -0
- package/build/login/consts.js.map +1 -1
- package/build/login/consts.local.d.ts +3 -0
- package/build/login/consts.local.d.ts.map +1 -1
- package/build/login/consts.local.js +5 -0
- package/build/login/consts.local.js.map +1 -1
- package/build/login/credit/types.d.ts +7 -0
- package/build/login/credit/types.d.ts.map +1 -0
- package/build/login/credit/types.js +2 -0
- package/build/login/credit/types.js.map +1 -0
- package/build/login/credit.d.ts +1 -1
- package/build/login/credit.d.ts.map +1 -1
- package/build/login/env/types.d.ts +35 -0
- package/build/login/env/types.d.ts.map +1 -0
- package/build/login/env/types.js +2 -0
- package/build/login/env/types.js.map +1 -0
- package/build/login/env.d.ts +5 -29
- package/build/login/env.d.ts.map +1 -1
- package/build/login/env.js +63 -80
- package/build/login/env.js.map +1 -1
- package/build/login/hook.d.ts +15 -0
- package/build/login/hook.d.ts.map +1 -1
- package/build/login/hook.js +25 -7
- package/build/login/hook.js.map +1 -1
- package/build/login/i18n.js +9 -9
- package/build/login/i18n.js.map +1 -1
- package/build/login/index.d.ts +10 -0
- package/build/login/index.d.ts.map +1 -1
- package/build/login/index.js +1 -0
- package/build/login/index.js.map +1 -1
- package/build/login/land/types.d.ts +52 -0
- package/build/login/land/types.d.ts.map +1 -0
- package/build/login/land/types.js +2 -0
- package/build/login/land/types.js.map +1 -0
- package/build/login/land.d.ts +5 -34
- package/build/login/land.d.ts.map +1 -1
- package/build/login/land.js +88 -122
- package/build/login/land.js.map +1 -1
- package/build/login/methods/types.d.ts +30 -0
- package/build/login/methods/types.d.ts.map +1 -0
- package/build/login/methods/types.js +2 -0
- package/build/login/methods/types.js.map +1 -0
- package/build/login/methods.d.ts +5 -23
- package/build/login/methods.d.ts.map +1 -1
- package/build/login/methods.js +67 -79
- package/build/login/methods.js.map +1 -1
- package/build/login/resume/types.d.ts +24 -0
- package/build/login/resume/types.d.ts.map +1 -0
- package/build/login/resume/types.js +2 -0
- package/build/login/resume/types.js.map +1 -0
- package/build/login/resume.d.ts +5 -17
- package/build/login/resume.d.ts.map +1 -1
- package/build/login/resume.js +35 -44
- package/build/login/resume.js.map +1 -1
- package/build/login/screen.d.ts.map +1 -1
- package/build/login/screen.js +9 -9
- package/build/login/screen.js.map +1 -1
- package/build/login/service.d.ts.map +1 -1
- package/build/login/service.js +61 -18
- package/build/login/service.js.map +1 -1
- package/build/login/start/types.d.ts +29 -0
- package/build/login/start/types.d.ts.map +1 -0
- package/build/login/start/types.js +2 -0
- package/build/login/start/types.js.map +1 -0
- package/build/login/start.d.ts +5 -0
- package/build/login/start.d.ts.map +1 -0
- package/build/login/start.js +36 -0
- package/build/login/start.js.map +1 -0
- package/build/login/surrogate/types.d.ts +9 -0
- package/build/login/surrogate/types.d.ts.map +1 -0
- package/build/login/surrogate/types.js +2 -0
- package/build/login/surrogate/types.js.map +1 -0
- package/build/login/surrogate.d.ts +2 -1
- package/build/login/surrogate.d.ts.map +1 -1
- package/build/login/surrogate.js.map +1 -1
- package/build/login/terms/types.d.ts +108 -0
- package/build/login/terms/types.d.ts.map +1 -0
- package/build/login/terms/types.js +2 -0
- package/build/login/terms/types.js.map +1 -0
- package/build/login/terms.d.ts +13 -53
- package/build/login/terms.d.ts.map +1 -1
- package/build/login/terms.js +209 -234
- package/build/login/terms.js.map +1 -1
- package/build/login/types.d.ts +16 -79
- package/build/login/types.d.ts.map +1 -1
- package/build/manager/entrypoints.d.ts +9 -1
- package/build/manager/entrypoints.d.ts.map +1 -1
- package/build/manager/plugins/exports.d.ts +1 -0
- package/build/manager/plugins/exports.d.ts.map +1 -1
- package/build/manager/plugins/exports.js.map +1 -1
- package/build/manager/plugins/index.d.ts +2 -1
- package/build/manager/plugins/index.d.ts.map +1 -1
- package/build/manager/plugins/index.js +3 -3
- package/build/manager/plugins/index.js.map +1 -1
- package/build/manager/plugins/methods.js +2 -2
- package/build/manager/plugins/methods.js.map +1 -1
- package/build/manager/plugins/registry/types.d.ts +10 -0
- package/build/manager/plugins/registry/types.d.ts.map +1 -0
- package/build/manager/plugins/registry/types.js +2 -0
- package/build/manager/plugins/registry/types.js.map +1 -0
- package/build/manager/plugins/registry.d.ts +4 -4
- package/build/manager/plugins/registry.d.ts.map +1 -1
- package/build/manager/plugins/registry.js +10 -6
- package/build/manager/plugins/registry.js.map +1 -1
- package/build/manager/plugins/tunnel-consumer.js +2 -2
- package/build/manager/plugins/tunnel-consumer.js.map +1 -1
- package/package.json +23 -23
- package/src/components/dispatcher/component.tsx +4 -4
- package/src/helper.ts +2 -2
- package/src/login/adopt/types.ts +25 -0
- package/src/login/adopt.ts +20 -25
- package/src/login/consts.local.ts +6 -0
- package/src/login/consts.ts +7 -0
- package/src/login/credit/types.ts +6 -0
- package/src/login/credit.ts +1 -1
- package/src/login/env/types.ts +35 -0
- package/src/login/env.ts +60 -72
- package/src/login/hook.ts +28 -7
- package/src/login/i18n.ts +10 -9
- package/src/login/index.ts +10 -0
- package/src/login/land/types.ts +54 -0
- package/src/login/land.ts +95 -129
- package/src/login/methods/types.ts +32 -0
- package/src/login/methods.ts +75 -82
- package/src/login/resume/types.ts +24 -0
- package/src/login/resume.ts +39 -42
- package/src/login/screen.tsx +13 -14
- package/src/login/service.ts +73 -19
- package/src/login/start/types.ts +30 -0
- package/src/login/start.ts +44 -0
- package/src/login/surrogate/types.ts +9 -0
- package/src/login/surrogate.ts +2 -1
- package/src/login/terms/types.ts +122 -0
- package/src/login/terms.ts +256 -259
- package/src/login/types.ts +14 -87
- package/src/manager/README.md +1 -1
- package/src/manager/plugins/exports.ts +1 -0
- package/src/manager/plugins/index.ts +4 -3
- package/src/manager/plugins/methods.ts +2 -2
- package/src/manager/plugins/registry/types.ts +10 -0
- package/src/manager/plugins/registry.ts +15 -8
- package/src/manager/plugins/tunnel-consumer.tsx +2 -2
- package/tests/land.spec.ts +19 -19
- package/tests/login.spec.ts +34 -34
- package/tests/target.spec.ts +210 -0
- package/tests/terms-deferred.spec.ts +6 -6
- package/tests/terms.spec.ts +31 -31
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consts.local.d.ts","sourceRoot":"","sources":["../../src/login/consts.local.ts"],"names":[],"mappings":"AAAA,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"}
|
|
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,3 +1,4 @@
|
|
|
1
|
+
import { LoginOutcome } from './consts.js';
|
|
1
2
|
/**
|
|
2
3
|
* The page the card sits in.
|
|
3
4
|
*
|
|
@@ -22,4 +23,8 @@ export const DEFAULT_LABEL = {
|
|
|
22
23
|
billing: 'Billing Terms',
|
|
23
24
|
product: '{{product}} Product Terms',
|
|
24
25
|
};
|
|
26
|
+
/** Outcomes after which nobody was signed in, so a screen parked for the landing must not wait. */
|
|
27
|
+
export const UNSIGNED_OUTCOMES = new Set([
|
|
28
|
+
LoginOutcome.Blocked, LoginOutcome.Failed, LoginOutcome.Gesture,
|
|
29
|
+
]);
|
|
25
30
|
//# sourceMappingURL=consts.local.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consts.local.js","sourceRoot":"","sources":["../../src/login/consts.local.ts"],"names":[],"mappings":"
|
|
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"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface ResolvedCredit {
|
|
2
|
+
/** Whether "Powered by OwlMeans" is rendered. */
|
|
3
|
+
poweredBy: boolean;
|
|
4
|
+
/** The product and organization line, already composed. Null when there is nothing to say. */
|
|
5
|
+
line: string | null;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/login/credit/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,iDAAiD;IACjD,SAAS,EAAE,OAAO,CAAA;IAClB,8FAA8F;IAC9F,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/login/credit/types.ts"],"names":[],"mappings":""}
|
package/build/login/credit.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credit.d.ts","sourceRoot":"","sources":["../../src/login/credit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"credit.d.ts","sourceRoot":"","sources":["../../src/login/credit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAuBvD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,aAAa,SAClB,iBAAiB,UAAU,aAAa,YAAY,MAAM,KAC/D,cA2BF,CAAA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { LoginEnv } from '../types.js';
|
|
2
|
+
/** What this browsing context is for a sign-in: framed, the surrogate window, opened by another. */
|
|
3
|
+
export interface LoginEnvHelper {
|
|
4
|
+
/**
|
|
5
|
+
* Whether this document is embedded in a frame.
|
|
6
|
+
*
|
|
7
|
+
* Reading `window.top` across origins throws, and that throw is itself the answer: a `top` that
|
|
8
|
+
* differs and a `top` that cannot be reached both mean "framed".
|
|
9
|
+
*/
|
|
10
|
+
isEmbedded: () => boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Record that this window is the surrogate login window, while that is still knowable.
|
|
13
|
+
*
|
|
14
|
+
* Must run on the surrogate's **first** load, before the flow navigates to the provider:
|
|
15
|
+
* `window.name` is the only evidence at that point, and browsers clear it as soon as a top-level
|
|
16
|
+
* context goes cross-origin — so by the time the provider redirects back, the name is gone and
|
|
17
|
+
* this window would look like an ordinary tab.
|
|
18
|
+
*
|
|
19
|
+
* Idempotent, and a no-op in every window that is not the surrogate.
|
|
20
|
+
*/
|
|
21
|
+
markSurrogate: () => void;
|
|
22
|
+
/** Whether this document is the surrogate login window. */
|
|
23
|
+
isSurrogate: () => boolean;
|
|
24
|
+
/** Forget the surrogate marker — called once its token has been handed back. */
|
|
25
|
+
clearSurrogate: () => void;
|
|
26
|
+
/**
|
|
27
|
+
* Default login environment.
|
|
28
|
+
*
|
|
29
|
+
* The single source of environment truth for cascade selection — a plugin's `match` reads this
|
|
30
|
+
* and never probes `window` itself, so a non-DOM host can drive the same plugins by supplying its
|
|
31
|
+
* own descriptor.
|
|
32
|
+
*/
|
|
33
|
+
defaultLoginEnv: () => LoginEnv;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/login/env/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAE3C,oGAAoG;AACpG,MAAM,WAAW,cAAc;IAC7B;;;;;OAKG;IACH,UAAU,EAAE,MAAM,OAAO,CAAA;IACzB;;;;;;;;;OASG;IACH,aAAa,EAAE,MAAM,IAAI,CAAA;IACzB,2DAA2D;IAC3D,WAAW,EAAE,MAAM,OAAO,CAAA;IAC1B,gFAAgF;IAChF,cAAc,EAAE,MAAM,IAAI,CAAA;IAC1B;;;;;;OAMG;IACH,eAAe,EAAE,MAAM,QAAQ,CAAA;CAChC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/login/env/types.ts"],"names":[],"mappings":""}
|
package/build/login/env.d.ts
CHANGED
|
@@ -1,32 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
* Reading `window.top` across origins throws, and that throw is itself the answer: a `top` that
|
|
6
|
-
* differs and a `top` that cannot be reached both mean "framed".
|
|
7
|
-
*/
|
|
8
|
-
export declare const isEmbedded: () => boolean;
|
|
9
|
-
/**
|
|
10
|
-
* Record that this window is the surrogate login window, while that is still knowable.
|
|
11
|
-
*
|
|
12
|
-
* Must run on the surrogate's **first** load, before the flow navigates to the provider:
|
|
13
|
-
* `window.name` is the only evidence at that point, and browsers clear it as soon as a top-level
|
|
14
|
-
* context goes cross-origin — so by the time the provider redirects back, the name is gone and
|
|
15
|
-
* this window would look like an ordinary tab.
|
|
16
|
-
*
|
|
17
|
-
* Idempotent, and a no-op in every window that is not the surrogate.
|
|
18
|
-
*/
|
|
1
|
+
import type { LoginEnvHelper } from './env/types.js';
|
|
2
|
+
export declare const createLoginEnvHelper: () => LoginEnvHelper;
|
|
3
|
+
export declare const loginEnvHelper: LoginEnvHelper;
|
|
4
|
+
/** @deprecated compat:factory-refactor — use `loginEnvHelper.markSurrogate()` */
|
|
19
5
|
export declare const markSurrogate: () => void;
|
|
20
|
-
/**
|
|
21
|
-
export declare const isSurrogate: () => boolean;
|
|
22
|
-
/** Forget the surrogate marker — called once its token has been handed back. */
|
|
6
|
+
/** @deprecated compat:factory-refactor — use `loginEnvHelper.clearSurrogate()` */
|
|
23
7
|
export declare const clearSurrogate: () => void;
|
|
24
|
-
/**
|
|
25
|
-
* Default login environment.
|
|
26
|
-
*
|
|
27
|
-
* The single source of environment truth for cascade selection — a plugin's `match` reads this
|
|
28
|
-
* and never probes `window` itself, so a non-DOM host can drive the same plugins by supplying its
|
|
29
|
-
* own descriptor.
|
|
30
|
-
*/
|
|
31
|
-
export declare const defaultLoginEnv: () => LoginEnv;
|
|
32
8
|
//# sourceMappingURL=env.d.ts.map
|
package/build/login/env.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/login/env.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/login/env.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAEpD,eAAO,MAAM,oBAAoB,QAAO,cA6DvC,CAAA;AAED,eAAO,MAAM,cAAc,gBAAyB,CAAA;AAEpD,iFAAiF;AACjF,eAAO,MAAM,aAAa,QAAO,IAAsC,CAAA;AAEvE,kFAAkF;AAClF,eAAO,MAAM,cAAc,QAAO,IAAuC,CAAA"}
|
package/build/login/env.js
CHANGED
|
@@ -1,84 +1,67 @@
|
|
|
1
1
|
import { LOGIN_SURROGATE_MARKER, LOGIN_SURROGATE_NAME } from './consts.js';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
window.sessionStorage.removeItem(LOGIN_SURROGATE_MARKER);
|
|
60
|
-
}
|
|
61
|
-
catch { /* nothing to clean up if storage was never available */ }
|
|
62
|
-
};
|
|
63
|
-
/**
|
|
64
|
-
* Default login environment.
|
|
65
|
-
*
|
|
66
|
-
* The single source of environment truth for cascade selection — a plugin's `match` reads this
|
|
67
|
-
* and never probes `window` itself, so a non-DOM host can drive the same plugins by supplying its
|
|
68
|
-
* own descriptor.
|
|
69
|
-
*/
|
|
70
|
-
export const defaultLoginEnv = () => {
|
|
71
|
-
const hasWindow = typeof window !== 'undefined';
|
|
72
|
-
if (!hasWindow) {
|
|
73
|
-
return { hasWindow, embedded: false, surrogate: false, hasOpener: false };
|
|
74
|
-
}
|
|
75
|
-
return {
|
|
76
|
-
hasWindow,
|
|
77
|
-
embedded: isEmbedded(),
|
|
78
|
-
surrogate: isSurrogate(),
|
|
79
|
-
// `Cross-Origin-Opener-Policy: same-origin` from the provider severs this permanently, which
|
|
80
|
-
// is why it is observed rather than assumed from "we were opened by someone".
|
|
81
|
-
hasOpener: window.opener != null,
|
|
2
|
+
export const createLoginEnvHelper = () => {
|
|
3
|
+
const isEmbedded = () => {
|
|
4
|
+
try {
|
|
5
|
+
return window.self !== window.top;
|
|
6
|
+
}
|
|
7
|
+
catch {
|
|
8
|
+
return true;
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
const markSurrogate = () => {
|
|
12
|
+
if (typeof window === 'undefined' || window.name !== LOGIN_SURROGATE_NAME) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
try {
|
|
16
|
+
window.sessionStorage.setItem(LOGIN_SURROGATE_MARKER, '1');
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
// Storage can be unavailable (private modes, blocked cookies). The `window.name` check still
|
|
20
|
+
// covers the case where nothing cross-origin happened in between.
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
const isSurrogate = () => {
|
|
24
|
+
if (typeof window === 'undefined') {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
if (window.name === LOGIN_SURROGATE_NAME) {
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
try {
|
|
31
|
+
return window.sessionStorage.getItem(LOGIN_SURROGATE_MARKER) === '1';
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
const clearSurrogate = () => {
|
|
38
|
+
if (typeof window === 'undefined') {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
try {
|
|
42
|
+
window.sessionStorage.removeItem(LOGIN_SURROGATE_MARKER);
|
|
43
|
+
}
|
|
44
|
+
catch { /* nothing to clean up if storage was never available */ }
|
|
45
|
+
};
|
|
46
|
+
const defaultLoginEnv = () => {
|
|
47
|
+
const hasWindow = typeof window !== 'undefined';
|
|
48
|
+
if (!hasWindow) {
|
|
49
|
+
return { hasWindow, embedded: false, surrogate: false, hasOpener: false };
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
hasWindow,
|
|
53
|
+
embedded: isEmbedded(),
|
|
54
|
+
surrogate: isSurrogate(),
|
|
55
|
+
// `Cross-Origin-Opener-Policy: same-origin` from the provider severs this permanently, which
|
|
56
|
+
// is why it is observed rather than assumed from "we were opened by someone".
|
|
57
|
+
hasOpener: window.opener != null,
|
|
58
|
+
};
|
|
82
59
|
};
|
|
60
|
+
return { isEmbedded, markSurrogate, isSurrogate, clearSurrogate, defaultLoginEnv };
|
|
83
61
|
};
|
|
62
|
+
export const loginEnvHelper = createLoginEnvHelper();
|
|
63
|
+
/** @deprecated compat:factory-refactor — use `loginEnvHelper.markSurrogate()` */
|
|
64
|
+
export const markSurrogate = () => loginEnvHelper.markSurrogate();
|
|
65
|
+
/** @deprecated compat:factory-refactor — use `loginEnvHelper.clearSurrogate()` */
|
|
66
|
+
export const clearSurrogate = () => loginEnvHelper.clearSurrogate();
|
|
84
67
|
//# sourceMappingURL=env.js.map
|
package/build/login/env.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.js","sourceRoot":"","sources":["../../src/login/env.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"env.js","sourceRoot":"","sources":["../../src/login/env.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAI1E,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAmB,EAAE;IACvD,MAAM,UAAU,GAAG,GAAY,EAAE;QAC/B,IAAI,CAAC;YACH,OAAO,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,GAAG,CAAA;QACnC,CAAC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,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,CAAA;QAC3E,CAAC;QAED,OAAO;YACL,SAAS;YACT,QAAQ,EAAE,UAAU,EAAE;YACtB,SAAS,EAAE,WAAW,EAAE;YACxB,6FAA6F;YAC7F,8EAA8E;YAC9E,SAAS,EAAE,MAAM,CAAC,MAAM,IAAI,IAAI;SACjC,CAAA;IACH,CAAC,CAAA;IAED,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,EAAE,CAAA;AACpF,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,oBAAoB,EAAE,CAAA;AAEpD,iFAAiF;AACjF,MAAM,CAAC,MAAM,aAAa,GAAG,GAAS,EAAE,CAAC,cAAc,CAAC,aAAa,EAAE,CAAA;AAEvE,kFAAkF;AAClF,MAAM,CAAC,MAAM,cAAc,GAAG,GAAS,EAAE,CAAC,cAAc,CAAC,cAAc,EAAE,CAAA"}
|
package/build/login/hook.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type MouseEvent } from 'react';
|
|
2
|
+
import type { LandOptions } from './land/types.js';
|
|
2
3
|
/**
|
|
3
4
|
* Wiring for a "Log in" control: where it points, and what it does when clicked.
|
|
4
5
|
*
|
|
@@ -7,6 +8,12 @@ import { type MouseEvent } from 'react';
|
|
|
7
8
|
* an app embedded in a frame runs the flow one window up, because the provider refuses to be
|
|
8
9
|
* framed and its cookies are third-party there.
|
|
9
10
|
*
|
|
11
|
+
* `target` is the screen to land on once signed in — sign-in FIRST, then the screen, in an ordinary
|
|
12
|
+
* tab and in a framed application alike, with any pending post-sign-in step (a consent screen) run
|
|
13
|
+
* on the way. The control still leads to the dispatcher; the target is parked for the landing
|
|
14
|
+
* (`LoginRequest.target`), and somebody already signed in goes straight to it (`loginStartOf(ctx).startLogin`).
|
|
15
|
+
* Without a target the landing is the ordinary one.
|
|
16
|
+
*
|
|
10
17
|
* The returned handler is deliberately NOT async and awaits nothing before delegating: a window
|
|
11
18
|
* opened after the user gesture has finished being handled is eaten by the popup blocker.
|
|
12
19
|
*
|
|
@@ -34,4 +41,12 @@ export declare const useLogin: (target?: string) => readonly [string, (event?: M
|
|
|
34
41
|
* `onClick={onLogOut}` keeps compiling everywhere.
|
|
35
42
|
*/
|
|
36
43
|
export declare const useLogout: (target?: string) => ((event?: MouseEvent) => void);
|
|
44
|
+
/**
|
|
45
|
+
* For a component that runs its own post-login step (the marketing-consent screen, for one) to
|
|
46
|
+
* call once it is satisfied — moves the flow on to the next step, or the ordinary landing.
|
|
47
|
+
*
|
|
48
|
+
* Not async at the call site by accident of its own — it is a callback a component holds and
|
|
49
|
+
* fires later, so nothing here needs the synchronous-gesture discipline `useLogin`/`useLogout` do.
|
|
50
|
+
*/
|
|
51
|
+
export declare const useContinueLogin: () => ((opts?: LandOptions) => Promise<void>);
|
|
37
52
|
//# sourceMappingURL=hook.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../src/login/hook.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../src/login/hook.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,OAAO,CAAA;AAMpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAMlD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,QAAQ,YAAa,MAAM,KAAG,SAAS,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE,UAAU,KAAK,IAAI,CAcxF,CAAA;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,SAAS,YAAa,MAAM,KAAG,CAAC,CAAC,KAAK,CAAC,EAAE,UAAU,KAAK,IAAI,CAcxE,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,QAAO,CAAC,CAAC,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,CAQzE,CAAA"}
|
package/build/login/hook.js
CHANGED
|
@@ -2,7 +2,9 @@ import { useCallback } from 'react';
|
|
|
2
2
|
import { useContext, useNavigate } from '@owlmeans/client';
|
|
3
3
|
import { DISPATCHER } from '@owlmeans/auth';
|
|
4
4
|
import { LoginIntent, LOGIN_SERVICE } from './consts.js';
|
|
5
|
+
import { loginLandingOf } from './land.js';
|
|
5
6
|
import { surrogatePath } from './surrogate.js';
|
|
7
|
+
import { loginStartOf } from './start.js';
|
|
6
8
|
/**
|
|
7
9
|
* Wiring for a "Log in" control: where it points, and what it does when clicked.
|
|
8
10
|
*
|
|
@@ -11,6 +13,12 @@ import { surrogatePath } from './surrogate.js';
|
|
|
11
13
|
* an app embedded in a frame runs the flow one window up, because the provider refuses to be
|
|
12
14
|
* framed and its cookies are third-party there.
|
|
13
15
|
*
|
|
16
|
+
* `target` is the screen to land on once signed in — sign-in FIRST, then the screen, in an ordinary
|
|
17
|
+
* tab and in a framed application alike, with any pending post-sign-in step (a consent screen) run
|
|
18
|
+
* on the way. The control still leads to the dispatcher; the target is parked for the landing
|
|
19
|
+
* (`LoginRequest.target`), and somebody already signed in goes straight to it (`loginStartOf(ctx).startLogin`).
|
|
20
|
+
* Without a target the landing is the ordinary one.
|
|
21
|
+
*
|
|
14
22
|
* The returned handler is deliberately NOT async and awaits nothing before delegating: a window
|
|
15
23
|
* opened after the user gesture has finished being handled is eaten by the popup blocker.
|
|
16
24
|
*
|
|
@@ -26,13 +34,8 @@ export const useLogin = (target) => {
|
|
|
26
34
|
const path = dispatcher.path();
|
|
27
35
|
const onLogin = useCallback((event) => {
|
|
28
36
|
event?.preventDefault();
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
url: path,
|
|
32
|
-
target,
|
|
33
|
-
// Only a component may call `useNavigate`, so the in-app continuation is handed to the
|
|
34
|
-
// plugin rather than reinvented by it.
|
|
35
|
-
navigate: () => { nav.go(target ?? DISPATCHER); },
|
|
37
|
+
void loginStartOf(context).startLogin({
|
|
38
|
+
url: path, target, go: alias => nav.go(alias),
|
|
36
39
|
});
|
|
37
40
|
}, [context, path, target]);
|
|
38
41
|
return [path, onLogin];
|
|
@@ -68,4 +71,19 @@ export const useLogout = (target) => {
|
|
|
68
71
|
});
|
|
69
72
|
}, [context, path, target]);
|
|
70
73
|
};
|
|
74
|
+
/**
|
|
75
|
+
* For a component that runs its own post-login step (the marketing-consent screen, for one) to
|
|
76
|
+
* call once it is satisfied — moves the flow on to the next step, or the ordinary landing.
|
|
77
|
+
*
|
|
78
|
+
* Not async at the call site by accident of its own — it is a callback a component holds and
|
|
79
|
+
* fires later, so nothing here needs the synchronous-gesture discipline `useLogin`/`useLogout` do.
|
|
80
|
+
*/
|
|
81
|
+
export const useContinueLogin = () => {
|
|
82
|
+
const context = useContext();
|
|
83
|
+
const nav = useNavigate();
|
|
84
|
+
return useCallback(async (opts) => {
|
|
85
|
+
const landing = await loginLandingOf(context).continueLogin(opts);
|
|
86
|
+
await nav.go(landing.alias, { params: landing.params, query: landing.query });
|
|
87
|
+
}, [context, nav]);
|
|
88
|
+
};
|
|
71
89
|
//# sourceMappingURL=hook.js.map
|
package/build/login/hook.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hook.js","sourceRoot":"","sources":["../../src/login/hook.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAmB,MAAM,OAAO,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAG1D,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"hook.js","sourceRoot":"","sources":["../../src/login/hook.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAmB,MAAM,OAAO,CAAA;AACpD,OAAO,EAA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from '@owlmeans/i18n';
|
|
2
1
|
import en from './i18n/en.json' with { type: 'json' };
|
|
3
2
|
import pl from './i18n/pl.json' with { type: 'json' };
|
|
4
3
|
import ru from './i18n/ru.json' with { type: 'json' };
|
|
@@ -7,6 +6,7 @@ import uk from './i18n/uk.json' with { type: 'json' };
|
|
|
7
6
|
import es from './i18n/es.json' with { type: 'json' };
|
|
8
7
|
import de from './i18n/de.json' with { type: 'json' };
|
|
9
8
|
import fr from './i18n/fr.json' with { type: 'json' };
|
|
9
|
+
import { i18nHelper } from '@owlmeans/i18n';
|
|
10
10
|
/**
|
|
11
11
|
* The sign-in screen's copy, registered into the `auth` library resource.
|
|
12
12
|
*
|
|
@@ -16,12 +16,12 @@ import fr from './i18n/fr.json' with { type: 'json' };
|
|
|
16
16
|
* and every styled one read the same keys — so the seven-language rule holds on every path a user
|
|
17
17
|
* can actually reach, not only the pretty one.
|
|
18
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);
|
|
19
|
+
i18nHelper.addI18nLib('en', 'auth', en);
|
|
20
|
+
i18nHelper.addI18nLib('pl', 'auth', pl);
|
|
21
|
+
i18nHelper.addI18nLib('ru', 'auth', ru);
|
|
22
|
+
i18nHelper.addI18nLib('be', 'auth', be);
|
|
23
|
+
i18nHelper.addI18nLib('uk', 'auth', uk);
|
|
24
|
+
i18nHelper.addI18nLib('es', 'auth', es);
|
|
25
|
+
i18nHelper.addI18nLib('de', 'auth', de);
|
|
26
|
+
i18nHelper.addI18nLib('fr', 'auth', fr);
|
|
27
27
|
//# sourceMappingURL=i18n.js.map
|
package/build/login/i18n.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../../src/login/i18n.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../../src/login/i18n.ts"],"names":[],"mappings":"AAEA,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;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAE3C;;;;;;;;GAQG;AACH,UAAU,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,CAAA;AACvC,UAAU,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,CAAA;AACvC,UAAU,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,CAAA;AACvC,UAAU,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,CAAA;AACvC,UAAU,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,CAAA;AACvC,UAAU,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,CAAA;AACvC,UAAU,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,CAAA;AACvC,UAAU,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,CAAA"}
|
package/build/login/index.d.ts
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import './i18n.js';
|
|
2
2
|
export * from './consts.js';
|
|
3
3
|
export * from './types.js';
|
|
4
|
+
export type * from './env/types.js';
|
|
5
|
+
export type * from './adopt/types.js';
|
|
6
|
+
export type * from './methods/types.js';
|
|
7
|
+
export type * from './resume/types.js';
|
|
8
|
+
export type * from './terms/types.js';
|
|
9
|
+
export type * from './credit/types.js';
|
|
10
|
+
export type * from './surrogate/types.js';
|
|
11
|
+
export type * from './land/types.js';
|
|
12
|
+
export type * from './start/types.js';
|
|
4
13
|
export * from './env.js';
|
|
5
14
|
export * from './adopt.js';
|
|
6
15
|
export * from './methods.js';
|
|
@@ -12,6 +21,7 @@ export * from './credit.js';
|
|
|
12
21
|
export * from './surrogate.js';
|
|
13
22
|
export * from './screen.js';
|
|
14
23
|
export * from './service.js';
|
|
24
|
+
export * from './start.js';
|
|
15
25
|
export * from './hook.js';
|
|
16
26
|
export * from './land.js';
|
|
17
27
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +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,mBAAmB,CAAA;AACjC,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA"}
|
|
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,mBAAmB,gBAAgB,CAAA;AACnC,mBAAmB,kBAAkB,CAAA;AACrC,mBAAmB,oBAAoB,CAAA;AACvC,mBAAmB,mBAAmB,CAAA;AACtC,mBAAmB,kBAAkB,CAAA;AACrC,mBAAmB,mBAAmB,CAAA;AACtC,mBAAmB,sBAAsB,CAAA;AACzC,mBAAmB,iBAAiB,CAAA;AACpC,mBAAmB,kBAAkB,CAAA;AACrC,cAAc,UAAU,CAAA;AACxB,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA;AACjC,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA"}
|
package/build/login/index.js
CHANGED
package/build/login/index.js.map
CHANGED
|
@@ -1 +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;
|
|
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;AAU1B,cAAc,UAAU,CAAA;AACxB,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA;AACjC,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { LoginLandingParams } from '../types.js';
|
|
2
|
+
/** Where a finished sign-in (or a pending step) lands. */
|
|
3
|
+
export interface LoginLanding {
|
|
4
|
+
alias: string;
|
|
5
|
+
params?: LoginLandingParams;
|
|
6
|
+
query?: LoginLandingParams;
|
|
7
|
+
/** The step alias this landing came from, when it came from one. */
|
|
8
|
+
step?: string;
|
|
9
|
+
}
|
|
10
|
+
/** Options for {@link LoginService.landAfterLogin}-shaped helpers (./land.js). */
|
|
11
|
+
export interface LandOptions {
|
|
12
|
+
/** Where to land when nothing else claims the flow. Defaults to `{ alias: HOME }`. */
|
|
13
|
+
fallback?: LoginLanding;
|
|
14
|
+
/** `false` skips `resumeSuspendedFlow` — the caller already has its own concrete destination. */
|
|
15
|
+
resume?: boolean;
|
|
16
|
+
/** Skip every step up to and including this alias — the resume point for a step's re-entry. */
|
|
17
|
+
after?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Overrides the step/hook timeout for this call. Mainly for tests; production callers leave it
|
|
20
|
+
* at the default (`LOGIN_STEP_TIMEOUT`).
|
|
21
|
+
*/
|
|
22
|
+
stepTimeout?: number;
|
|
23
|
+
}
|
|
24
|
+
/** Where one context's finished sign-in goes: its pending steps, a suspended flow, or the fallback. */
|
|
25
|
+
export interface LoginLandingHelper {
|
|
26
|
+
/**
|
|
27
|
+
* Where a finished sign-in should go: the first pending step, else a suspended flow, else the
|
|
28
|
+
* fallback (ordinarily `HOME`).
|
|
29
|
+
*
|
|
30
|
+
* Re-checks `env().surrogate` even though {@link landAfterLogin} already did — this function is
|
|
31
|
+
* also called directly (e.g. from `useContinueLogin`, after the surrogate window has already
|
|
32
|
+
* closed), and the check is cheap insurance either way: **no step and no landing hook ever runs
|
|
33
|
+
* inside the surrogate popup.** It has nothing of its own to collect and nowhere to navigate —
|
|
34
|
+
* the popup's own `DispatcherHOC` has no `navigate() → HOME` at all.
|
|
35
|
+
*/
|
|
36
|
+
continueLogin: (opts?: LandOptions) => Promise<LoginLanding>;
|
|
37
|
+
/**
|
|
38
|
+
* The whole post-sign-in landing decision: run any due landing hooks for a freshly seen token,
|
|
39
|
+
* then delegate to {@link continueLogin} for where the flow actually goes.
|
|
40
|
+
*
|
|
41
|
+
* This is what a plugin that just adopted a token calls in place of the old inline
|
|
42
|
+
* "`resumeSuspendedFlow` else `HOME`" — `DispatcherHOC`, the supervisor plugin and both Google
|
|
43
|
+
* plugins all replace their own copy of that logic with this one.
|
|
44
|
+
*/
|
|
45
|
+
landAfterLogin: (opts?: LandOptions) => Promise<LoginLanding>;
|
|
46
|
+
/**
|
|
47
|
+
* The absolute URL a landing resolves to — the same shape the supervisor and Google plugins
|
|
48
|
+
* already build their own `window.location.href` from.
|
|
49
|
+
*/
|
|
50
|
+
landingUrl: (landing: LoginLanding) => Promise<string>;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/login/land/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAErD,0DAA0D;AAC1D,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,kBAAkB,CAAA;IAC3B,KAAK,CAAC,EAAE,kBAAkB,CAAA;IAC1B,oEAAoE;IACpE,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,kFAAkF;AAClF,MAAM,WAAW,WAAW;IAC1B,sFAAsF;IACtF,QAAQ,CAAC,EAAE,YAAY,CAAA;IACvB,iGAAiG;IACjG,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,+FAA+F;IAC/F,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,uGAAuG;AACvG,MAAM,WAAW,kBAAkB;IACjC;;;;;;;;;OASG;IACH,aAAa,EAAE,CAAC,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,YAAY,CAAC,CAAA;IAC5D;;;;;;;OAOG;IACH,cAAc,EAAE,CAAC,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,YAAY,CAAC,CAAA;IAC7D;;;OAGG;IACH,UAAU,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;CACvD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/login/land/types.ts"],"names":[],"mappings":""}
|
package/build/login/land.d.ts
CHANGED
|
@@ -1,35 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* Re-checks `env().surrogate` even though {@link landAfterLogin} already did — this function is
|
|
7
|
-
* also called directly (e.g. from {@link useContinueLogin}, after the surrogate window has
|
|
8
|
-
* already closed), and the check is cheap insurance either way: **no step and no landing hook
|
|
9
|
-
* ever runs inside the surrogate popup.** It has nothing of its own to collect and nowhere to
|
|
10
|
-
* navigate — the popup's own `DispatcherHOC` has no `navigate() → HOME` at all.
|
|
11
|
-
*/
|
|
12
|
-
export declare const continueLogin: (ctx: LoginContext, opts?: LandOptions) => Promise<LoginLanding>;
|
|
13
|
-
/**
|
|
14
|
-
* The whole post-sign-in landing decision: run any due landing hooks for a freshly seen token,
|
|
15
|
-
* then delegate to {@link continueLogin} for where the flow actually goes.
|
|
16
|
-
*
|
|
17
|
-
* This is what a plugin that just adopted a token calls in place of the old inline
|
|
18
|
-
* "`resumeSuspendedFlow` else `HOME`" — `DispatcherHOC`, the supervisor plugin and both Google
|
|
19
|
-
* plugins all replace their own copy of that logic with this one.
|
|
20
|
-
*/
|
|
21
|
-
export declare const landAfterLogin: (ctx: LoginContext, opts?: LandOptions) => Promise<LoginLanding>;
|
|
22
|
-
/**
|
|
23
|
-
* The absolute URL a landing resolves to — the same shape the supervisor and Google plugins
|
|
24
|
-
* already build their own `window.location.href` from.
|
|
25
|
-
*/
|
|
26
|
-
export declare const landingUrl: (ctx: LoginContext, landing: LoginLanding) => Promise<string>;
|
|
27
|
-
/**
|
|
28
|
-
* For a component that runs its own post-login step (the marketing-consent screen, for one) to
|
|
29
|
-
* call once it is satisfied — moves the flow on to the next step, or the ordinary landing.
|
|
30
|
-
*
|
|
31
|
-
* Not async at the call site by accident of its own — it is a callback a component holds and
|
|
32
|
-
* fires later, so nothing here needs the synchronous-gesture discipline `useLogin`/`useLogout` do.
|
|
33
|
-
*/
|
|
34
|
-
export declare const useContinueLogin: () => ((opts?: LandOptions) => Promise<void>);
|
|
1
|
+
import type { LoginContext } from './types.js';
|
|
2
|
+
import type { LoginLandingHelper } from './land/types.js';
|
|
3
|
+
export declare const makeLoginLandingHelper: (ctx: LoginContext) => LoginLandingHelper;
|
|
4
|
+
/** The landing helper of a context — one per context. */
|
|
5
|
+
export declare const loginLandingOf: (target: LoginContext) => LoginLandingHelper;
|
|
35
6
|
//# sourceMappingURL=land.d.ts.map
|