@atlasauth/react 0.1.0
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/dist/AtlasProvider.d.ts +59 -0
- package/dist/AtlasProvider.js +248 -0
- package/dist/AtlasProvider.js.map +1 -0
- package/dist/appearance.d.ts +85 -0
- package/dist/appearance.js +98 -0
- package/dist/appearance.js.map +1 -0
- package/dist/components.d.ts +40 -0
- package/dist/components.js +241 -0
- package/dist/components.js.map +1 -0
- package/dist/fapi.d.ts +11 -0
- package/dist/fapi.js +24 -0
- package/dist/fapi.js.map +1 -0
- package/dist/hooks.d.ts +62 -0
- package/dist/hooks.js +96 -0
- package/dist/hooks.js.map +1 -0
- package/dist/i18n.d.ts +23 -0
- package/dist/i18n.js +83 -0
- package/dist/i18n.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +31 -0
- package/dist/index.js.map +1 -0
- package/dist/protect.d.ts +18 -0
- package/dist/protect.js +24 -0
- package/dist/protect.js.map +1 -0
- package/dist/types.d.ts +42 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/package.json +31 -0
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SignedIn = SignedIn;
|
|
4
|
+
exports.SignedOut = SignedOut;
|
|
5
|
+
exports.AtlasLoading = AtlasLoading;
|
|
6
|
+
exports.AtlasLoaded = AtlasLoaded;
|
|
7
|
+
exports.Protect = Protect;
|
|
8
|
+
exports.SignIn = SignIn;
|
|
9
|
+
exports.SignUp = SignUp;
|
|
10
|
+
exports.UserButton = UserButton;
|
|
11
|
+
exports.OrganizationSwitcher = OrganizationSwitcher;
|
|
12
|
+
exports.UserProfile = UserProfile;
|
|
13
|
+
exports.OrganizationProfile = OrganizationProfile;
|
|
14
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
15
|
+
const react_1 = require("react");
|
|
16
|
+
const js_1 = require("@atlasauth/js");
|
|
17
|
+
const AtlasProvider_1 = require("./AtlasProvider");
|
|
18
|
+
const fapi_1 = require("./fapi");
|
|
19
|
+
const hooks_1 = require("./hooks");
|
|
20
|
+
const appearance_1 = require("./appearance");
|
|
21
|
+
const i18n_1 = require("./i18n");
|
|
22
|
+
const protect_1 = require("./protect");
|
|
23
|
+
/**
|
|
24
|
+
* §10.2 components.
|
|
25
|
+
*
|
|
26
|
+
* `<SignIn/>` and `<SignUp/>` are "full multi-step flows driven entirely by the
|
|
27
|
+
* server-side attempt status". That phrase is the design: this file contains no
|
|
28
|
+
* decision about what comes next. It renders whatever `status` the server
|
|
29
|
+
* returned, via the exhaustive mapping in @atlasauth/js — so adding a step to the
|
|
30
|
+
* flow is a server change, and a client that has not shipped yet degrades to a
|
|
31
|
+
* visible "needs an update" rather than a blank screen.
|
|
32
|
+
*/
|
|
33
|
+
function useClass(appearanceKey, base) {
|
|
34
|
+
const { appearance } = (0, AtlasProvider_1.useAtlas)();
|
|
35
|
+
return (0, appearance_1.classFor)(appearanceKey, appearance, base);
|
|
36
|
+
}
|
|
37
|
+
function useText() {
|
|
38
|
+
const { catalog } = (0, AtlasProvider_1.useAtlas)();
|
|
39
|
+
return (key, vars) => (0, i18n_1.translate)(catalog, key, vars);
|
|
40
|
+
}
|
|
41
|
+
function SignedIn({ children }) {
|
|
42
|
+
const { isLoaded, isSignedIn } = (0, hooks_1.useUser)();
|
|
43
|
+
// Renders nothing while loading rather than flashing the signed-out branch.
|
|
44
|
+
if (!isLoaded || !isSignedIn)
|
|
45
|
+
return null;
|
|
46
|
+
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children });
|
|
47
|
+
}
|
|
48
|
+
function SignedOut({ children }) {
|
|
49
|
+
const { isLoaded, isSignedIn } = (0, hooks_1.useUser)();
|
|
50
|
+
if (!isLoaded || isSignedIn)
|
|
51
|
+
return null;
|
|
52
|
+
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children });
|
|
53
|
+
}
|
|
54
|
+
/** §10.2: render children only while the SDK is still loading. */
|
|
55
|
+
function AtlasLoading({ children }) {
|
|
56
|
+
const { isLoaded } = (0, hooks_1.useUser)();
|
|
57
|
+
return isLoaded ? null : (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children });
|
|
58
|
+
}
|
|
59
|
+
/** §10.2: render children only once the SDK has finished loading — the
|
|
60
|
+
* symmetric partner of {@link AtlasLoading}, so a consumer can show a spinner
|
|
61
|
+
* and its resolved content without hand-rolling the inverse condition. */
|
|
62
|
+
function AtlasLoaded({ children }) {
|
|
63
|
+
const { isLoaded } = (0, hooks_1.useUser)();
|
|
64
|
+
return isLoaded ? (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children }) : null;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* §10.2 `<Protect permission="…">`.
|
|
68
|
+
*
|
|
69
|
+
* A rendering helper, never an authorization boundary — anyone can flip the
|
|
70
|
+
* condition in devtools. The server checking the same permission is what
|
|
71
|
+
* actually stops them, and this component's job is only to avoid showing a
|
|
72
|
+
* button that would fail.
|
|
73
|
+
*/
|
|
74
|
+
function Protect({ children, fallback = null, ...condition }) {
|
|
75
|
+
const { claims, status } = (0, AtlasProvider_1.useAtlas)();
|
|
76
|
+
if (status === 'loading')
|
|
77
|
+
return null;
|
|
78
|
+
return (0, protect_1.evaluate)(claims, condition).allowed ? (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children }) : (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: fallback });
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* The server-driven flow shell.
|
|
82
|
+
*
|
|
83
|
+
* Every branch comes from `nextStep`, which is exhaustive — including the
|
|
84
|
+
* `unknown` case, which renders an honest message instead of nothing.
|
|
85
|
+
*/
|
|
86
|
+
function AttemptFlow({ attempt, onSubmit, busy, errors, titleKey, }) {
|
|
87
|
+
const t = useText();
|
|
88
|
+
const cardClass = useClass('card', 'atlas-card');
|
|
89
|
+
const titleClass = useClass('headerTitle', 'atlas-title');
|
|
90
|
+
const inputClass = useClass('formFieldInput', 'atlas-input');
|
|
91
|
+
const buttonClass = useClass('formButtonPrimary', 'atlas-button');
|
|
92
|
+
const errorClass = useClass('formFieldError', 'atlas-error');
|
|
93
|
+
const [values, setValues] = (0, react_1.useState)({});
|
|
94
|
+
const step = attempt ? (0, js_1.nextStep)(attempt) : { kind: 'collect_identifier' };
|
|
95
|
+
const field = (name, labelKey, type = 'text') => ((0, jsx_runtime_1.jsxs)("label", { className: "atlas-field", children: [(0, jsx_runtime_1.jsx)("span", { children: t(labelKey) }), (0, jsx_runtime_1.jsx)("input", { className: inputClass, type: type, value: values[name] ?? '', onChange: (event) => setValues((v) => ({ ...v, [name]: event.target.value })) }), errors
|
|
96
|
+
.filter((error) => error.param === name)
|
|
97
|
+
.map((error) => ((0, jsx_runtime_1.jsx)("span", { className: errorClass, children: error.message }, error.code)))] }, name));
|
|
98
|
+
const fields = () => {
|
|
99
|
+
switch (step.kind) {
|
|
100
|
+
case 'collect_identifier':
|
|
101
|
+
return [field('identifier', 'signIn.identifierLabel', 'email')];
|
|
102
|
+
case 'collect_first_factor':
|
|
103
|
+
return [field('password', 'signIn.passwordLabel', 'password')];
|
|
104
|
+
case 'collect_second_factor':
|
|
105
|
+
return [field('code', 'mfa.codeLabel')];
|
|
106
|
+
case 'enroll_second_factor':
|
|
107
|
+
/**
|
|
108
|
+
* Two codes, not one. §5.6 wants consecutive codes so a phone with a
|
|
109
|
+
* fast clock fails here rather than on every sign-in afterwards, and
|
|
110
|
+
* asking for one would hide that failure until it was expensive.
|
|
111
|
+
*/
|
|
112
|
+
return [
|
|
113
|
+
field('code', 'mfa.enrollFirstCodeLabel'),
|
|
114
|
+
field('secondCode', 'mfa.enrollSecondCodeLabel'),
|
|
115
|
+
];
|
|
116
|
+
case 'collect_email_code':
|
|
117
|
+
return [field('code', 'signIn.emailCodeLabel')];
|
|
118
|
+
case 'collect_new_password':
|
|
119
|
+
return [field('password', 'reset.newPasswordLabel', 'password')];
|
|
120
|
+
case 'await_oauth':
|
|
121
|
+
return [(0, jsx_runtime_1.jsx)("p", { children: t('signIn.magicLinkSent') }, "oauth")];
|
|
122
|
+
case 'done':
|
|
123
|
+
return [(0, jsx_runtime_1.jsx)("p", { children: t('signIn.checkOtherTab') }, "done")];
|
|
124
|
+
case 'restart':
|
|
125
|
+
return [(0, jsx_runtime_1.jsx)("p", { children: t('error.generic') }, "restart")];
|
|
126
|
+
default:
|
|
127
|
+
/**
|
|
128
|
+
* A status this SDK version does not know. Saying so beats rendering
|
|
129
|
+
* nothing, which is a blank login box the user cannot act on.
|
|
130
|
+
*/
|
|
131
|
+
return [
|
|
132
|
+
(0, jsx_runtime_1.jsx)("p", { className: errorClass, children: t('error.generic') }, "unknown"),
|
|
133
|
+
];
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: cardClass, children: [(0, jsx_runtime_1.jsx)("h1", { className: titleClass, children: t(titleKey) }), errors
|
|
137
|
+
.filter((error) => !error.param)
|
|
138
|
+
.map((error) => ((0, jsx_runtime_1.jsx)("p", { className: errorClass, role: "alert", children: error.message }, error.code))), (0, jsx_runtime_1.jsxs)("form", { onSubmit: (event) => {
|
|
139
|
+
event.preventDefault();
|
|
140
|
+
onSubmit(values);
|
|
141
|
+
}, children: [fields(), step.kind !== 'done' && step.kind !== 'await_oauth' ? ((0, jsx_runtime_1.jsx)("button", { className: buttonClass, disabled: busy, type: "submit", children: t('signIn.submit') })) : null] })] }));
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Drives the flow through `advance`, which owns the step-to-endpoint mapping.
|
|
145
|
+
* This component never decides what comes next — it renders the status the
|
|
146
|
+
* server returned and posts whatever the driver says the current step needs.
|
|
147
|
+
*/
|
|
148
|
+
function useFlow() {
|
|
149
|
+
const { publishableKey, frontendApi, reload, pendingAttempt } = (0, AtlasProvider_1.useAtlas)();
|
|
150
|
+
// Seeded from a redirect that came back mid-flow (e.g. OAuth needing a second
|
|
151
|
+
// factor), so the user resumes at the demanded step instead of starting over.
|
|
152
|
+
const [state, setState] = (0, react_1.useState)(() => (0, fapi_1.flowFromPending)(pendingAttempt));
|
|
153
|
+
const client = (0, react_1.useMemo)(() => new fapi_1.FapiClient({ publishableKey, baseUrl: frontendApi }), [frontendApi, publishableKey]);
|
|
154
|
+
const submit = (0, react_1.useCallback)((values) => {
|
|
155
|
+
void (async () => {
|
|
156
|
+
setState((current) => ({ ...current, busy: true, errors: [] }));
|
|
157
|
+
const next = await (0, fapi_1.advance)(client, state, values);
|
|
158
|
+
setState(next);
|
|
159
|
+
// On completion the response carries a one-time ticket (§7.1). Exchange
|
|
160
|
+
// it for cookies over a same-origin request — FAPI is cross-origin to
|
|
161
|
+
// the app and cannot set the cookie on the completion response itself —
|
|
162
|
+
// THEN re-boot so the rest of the app sees a signed-in user.
|
|
163
|
+
if (next.attempt?.status === 'complete') {
|
|
164
|
+
if (next.ticket) {
|
|
165
|
+
await client.post('/v1/client/tickets/exchange', {
|
|
166
|
+
attempt_id: next.attempt.id,
|
|
167
|
+
ticket: next.ticket,
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
await reload();
|
|
171
|
+
}
|
|
172
|
+
})();
|
|
173
|
+
}, [client, reload, state]);
|
|
174
|
+
/** §5.3: collect a sign-in completed by a link opened on another device. */
|
|
175
|
+
(0, react_1.useEffect)(() => {
|
|
176
|
+
if (!(0, fapi_1.shouldKeepPolling)(state))
|
|
177
|
+
return;
|
|
178
|
+
const timer = setInterval(() => {
|
|
179
|
+
void (async () => {
|
|
180
|
+
const { state: next, ticket } = await (0, fapi_1.pollAttempt)(client, state);
|
|
181
|
+
setState(next);
|
|
182
|
+
if (!ticket || !next.attempt)
|
|
183
|
+
return;
|
|
184
|
+
// The ticket is exchanged by a normal request, so no session token has
|
|
185
|
+
// ever appeared in a URL.
|
|
186
|
+
await client.post('/v1/client/tickets/exchange', {
|
|
187
|
+
attempt_id: next.attempt.id,
|
|
188
|
+
ticket,
|
|
189
|
+
});
|
|
190
|
+
await reload();
|
|
191
|
+
})();
|
|
192
|
+
}, 2_000);
|
|
193
|
+
return () => clearInterval(timer);
|
|
194
|
+
}, [client, reload, state]);
|
|
195
|
+
return { state, submit };
|
|
196
|
+
}
|
|
197
|
+
function SignIn(_props = {}) {
|
|
198
|
+
const { state, submit } = useFlow();
|
|
199
|
+
return ((0, jsx_runtime_1.jsx)(AttemptFlow, { attempt: state.attempt, busy: state.busy, errors: state.errors, titleKey: "signIn.title", onSubmit: submit }));
|
|
200
|
+
}
|
|
201
|
+
function SignUp(_props = {}) {
|
|
202
|
+
const { state, submit } = useFlow();
|
|
203
|
+
return ((0, jsx_runtime_1.jsx)(AttemptFlow, { attempt: state.attempt, busy: state.busy, errors: state.errors, titleKey: "signUp.title", onSubmit: submit }));
|
|
204
|
+
}
|
|
205
|
+
function UserButton() {
|
|
206
|
+
const { user } = (0, hooks_1.useUser)();
|
|
207
|
+
const { signOut } = (0, hooks_1.useAuth)();
|
|
208
|
+
const t = useText();
|
|
209
|
+
const [open, setOpen] = (0, react_1.useState)(false);
|
|
210
|
+
const avatarClass = useClass('avatar', 'atlas-avatar');
|
|
211
|
+
const menuClass = useClass('menu', 'atlas-menu');
|
|
212
|
+
const itemClass = useClass('menuItem', 'atlas-menu-item');
|
|
213
|
+
if (!user)
|
|
214
|
+
return null;
|
|
215
|
+
const label = [user.first_name, user.last_name].filter(Boolean).join(' ') || user.username || '';
|
|
216
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "atlas-user-button", children: [(0, jsx_runtime_1.jsx)("button", { className: avatarClass, onClick: () => setOpen((o) => !o), "aria-expanded": open, children: user.image_url ? (0, jsx_runtime_1.jsx)("img", { alt: "", src: user.image_url }) : (0, jsx_runtime_1.jsx)("span", { children: label.slice(0, 1) }) }), open ? ((0, jsx_runtime_1.jsxs)("div", { className: menuClass, role: "menu", children: [(0, jsx_runtime_1.jsx)("span", { className: itemClass, children: label }), (0, jsx_runtime_1.jsx)("button", { className: itemClass, onClick: () => void signOut(), children: t('userButton.signOut') })] })) : null] }));
|
|
217
|
+
}
|
|
218
|
+
function OrganizationSwitcher() {
|
|
219
|
+
const { memberships, organization, setActive } = (0, hooks_1.useOrganization)();
|
|
220
|
+
const t = useText();
|
|
221
|
+
const menuClass = useClass('menu', 'atlas-menu');
|
|
222
|
+
const itemClass = useClass('menuItem', 'atlas-menu-item');
|
|
223
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: menuClass, children: [(0, jsx_runtime_1.jsx)("button", { className: itemClass, onClick: () => void setActive(null), children: t('organization.personal') }), memberships.map((membership) => ((0, jsx_runtime_1.jsx)("button", { className: itemClass, disabled: membership.organization.id === organization?.id, onClick: () => void setActive(membership.organization.id), children: membership.organization.name }, membership.organization.id)))] }));
|
|
224
|
+
}
|
|
225
|
+
function UserProfile() {
|
|
226
|
+
const { user } = (0, hooks_1.useUser)();
|
|
227
|
+
const t = useText();
|
|
228
|
+
const cardClass = useClass('card', 'atlas-card');
|
|
229
|
+
if (!user)
|
|
230
|
+
return null;
|
|
231
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: cardClass, children: [(0, jsx_runtime_1.jsx)("h1", { children: t('userProfile.title') }), (0, jsx_runtime_1.jsxs)("section", { children: [(0, jsx_runtime_1.jsx)("h2", { children: t('userProfile.emailsSection') }), (0, jsx_runtime_1.jsx)("ul", { children: (user.email_addresses ?? []).map((email) => ((0, jsx_runtime_1.jsxs)("li", { children: [email.email_address, email.verified ? null : (0, jsx_runtime_1.jsxs)("em", { children: [" \u2014 ", t('userProfile.unverified')] })] }, email.id))) })] }), (0, jsx_runtime_1.jsxs)("section", { children: [(0, jsx_runtime_1.jsx)("h2", { children: t('userProfile.securitySection') }), (0, jsx_runtime_1.jsx)("p", { children: user.mfa_enabled ? '2FA on' : '2FA off' })] })] }));
|
|
232
|
+
}
|
|
233
|
+
function OrganizationProfile() {
|
|
234
|
+
const { organization, membership } = (0, hooks_1.useOrganization)();
|
|
235
|
+
const t = useText();
|
|
236
|
+
const cardClass = useClass('card', 'atlas-card');
|
|
237
|
+
if (!organization)
|
|
238
|
+
return null;
|
|
239
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: cardClass, children: [(0, jsx_runtime_1.jsx)("h1", { children: organization.name }), (0, jsx_runtime_1.jsxs)("p", { children: [t('organization.roleLabel'), ": ", membership?.role] }), (0, jsx_runtime_1.jsx)(Protect, { permission: "org:sys_memberships:manage", children: (0, jsx_runtime_1.jsx)("button", { children: t('organization.invite') }) })] }));
|
|
240
|
+
}
|
|
241
|
+
//# sourceMappingURL=components.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components.js","sourceRoot":"","sources":["../src/components.tsx"],"names":[],"mappings":";;AAqCA,4BAKC;AAED,8BAIC;AAGD,oCAGC;AAKD,kCAGC;AAUD,0BAQC;AAgMD,wBAYC;AAED,wBAYC;AAED,gCA8BC;AAED,oDAuBC;AAED,kCA6BC;AAED,kDAoBC;;AAxZD,iCAAkF;AAClF,sCAA4E;AAC5E,mDAA2C;AAC3C,iCAOgB;AAChB,mCAA4D;AAC5D,6CAAwC;AACxC,iCAAmC;AACnC,uCAA4D;AAE5D;;;;;;;;;GASG;AAEH,SAAS,QAAQ,CAAC,aAA6C,EAAE,IAAY;IAC3E,MAAM,EAAE,UAAU,EAAE,GAAG,IAAA,wBAAQ,GAAE,CAAC;IAClC,OAAO,IAAA,qBAAQ,EAAC,aAAa,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;AACnD,CAAC;AAED,SAAS,OAAO;IACd,MAAM,EAAE,OAAO,EAAE,GAAG,IAAA,wBAAQ,GAAE,CAAC;IAC/B,OAAO,CAAC,GAAW,EAAE,IAA6B,EAAE,EAAE,CAAC,IAAA,gBAAS,EAAC,OAAO,EAAE,GAAG,EAAE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CAAC,IAAI,GAAM,EAC5B,0CACG,CAAC,CAAC,wBAAwB,CAAC,QAAI,UAAU,EAAE,IAAI,IAC9C,EAGJ,uBAAC,OAAO,IAAC,UAAU,EAAC,4BAA4B,YAC9C,6CAAS,CAAC,CAAC,qBAAqB,CAAC,GAAU,GACnC,IACN,CACP,CAAC;AACJ,CAAC"}
|
package/dist/fapi.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The FAPI client and sign-in flow driver now live in `@atlasauth/js` — the pure,
|
|
3
|
+
* framework-agnostic browser FAPI flow — so the React `<SignIn/>` and the
|
|
4
|
+
* framework-agnostic `@atlasauth/embed` widget drive the exact same endpoints
|
|
5
|
+
* through one implementation and cannot diverge in what the server sees.
|
|
6
|
+
*
|
|
7
|
+
* This module is kept as a thin re-export so every existing importer inside the
|
|
8
|
+
* React SDK (`./components`, the public barrel, the tests) keeps resolving the
|
|
9
|
+
* driver from `./fapi` unchanged.
|
|
10
|
+
*/
|
|
11
|
+
export { FapiClient, advance, prepareFactor, pollAttempt, shouldKeepPolling, requestForStep, flowFromPending, initialFlow, getProviderToken, type FapiClientOptions, type FapiResponse, type FlowState, type ProviderToken, } from '@atlasauth/js';
|
package/dist/fapi.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getProviderToken = exports.initialFlow = exports.flowFromPending = exports.requestForStep = exports.shouldKeepPolling = exports.pollAttempt = exports.prepareFactor = exports.advance = exports.FapiClient = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The FAPI client and sign-in flow driver now live in `@atlasauth/js` — the pure,
|
|
6
|
+
* framework-agnostic browser FAPI flow — so the React `<SignIn/>` and the
|
|
7
|
+
* framework-agnostic `@atlasauth/embed` widget drive the exact same endpoints
|
|
8
|
+
* through one implementation and cannot diverge in what the server sees.
|
|
9
|
+
*
|
|
10
|
+
* This module is kept as a thin re-export so every existing importer inside the
|
|
11
|
+
* React SDK (`./components`, the public barrel, the tests) keeps resolving the
|
|
12
|
+
* driver from `./fapi` unchanged.
|
|
13
|
+
*/
|
|
14
|
+
var js_1 = require("@atlasauth/js");
|
|
15
|
+
Object.defineProperty(exports, "FapiClient", { enumerable: true, get: function () { return js_1.FapiClient; } });
|
|
16
|
+
Object.defineProperty(exports, "advance", { enumerable: true, get: function () { return js_1.advance; } });
|
|
17
|
+
Object.defineProperty(exports, "prepareFactor", { enumerable: true, get: function () { return js_1.prepareFactor; } });
|
|
18
|
+
Object.defineProperty(exports, "pollAttempt", { enumerable: true, get: function () { return js_1.pollAttempt; } });
|
|
19
|
+
Object.defineProperty(exports, "shouldKeepPolling", { enumerable: true, get: function () { return js_1.shouldKeepPolling; } });
|
|
20
|
+
Object.defineProperty(exports, "requestForStep", { enumerable: true, get: function () { return js_1.requestForStep; } });
|
|
21
|
+
Object.defineProperty(exports, "flowFromPending", { enumerable: true, get: function () { return js_1.flowFromPending; } });
|
|
22
|
+
Object.defineProperty(exports, "initialFlow", { enumerable: true, get: function () { return js_1.initialFlow; } });
|
|
23
|
+
Object.defineProperty(exports, "getProviderToken", { enumerable: true, get: function () { return js_1.getProviderToken; } });
|
|
24
|
+
//# sourceMappingURL=fapi.js.map
|
package/dist/fapi.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fapi.js","sourceRoot":"","sources":["../src/fapi.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;GASG;AACH,oCAcuB;AAbrB,gGAAA,UAAU,OAAA;AACV,6FAAA,OAAO,OAAA;AACP,mGAAA,aAAa,OAAA;AACb,iGAAA,WAAW,OAAA;AACX,uGAAA,iBAAiB,OAAA;AACjB,oGAAA,cAAc,OAAA;AACd,qGAAA,eAAe,OAAA;AACf,iGAAA,WAAW,OAAA;AACX,sGAAA,gBAAgB,OAAA"}
|
package/dist/hooks.d.ts
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { type CheckSessionOptions, type ProviderToken } from '@atlasauth/js';
|
|
2
|
+
import { type ProtectCondition } from './protect';
|
|
3
|
+
import type { AtlasOrganizationMembership, AtlasSession, AtlasUser } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* §10.1 hooks.
|
|
6
|
+
*
|
|
7
|
+
* Every one returns `isLoaded` alongside its data, and that is not ceremony.
|
|
8
|
+
* Without it a component cannot tell "still booting" from "signed out", so it
|
|
9
|
+
* renders a sign-in form for a fraction of a second on every page load — the
|
|
10
|
+
* flash of unauthenticated content that makes an app feel broken.
|
|
11
|
+
*/
|
|
12
|
+
export declare function useUser(): {
|
|
13
|
+
isLoaded: boolean;
|
|
14
|
+
isSignedIn: boolean;
|
|
15
|
+
user: AtlasUser | null;
|
|
16
|
+
/**
|
|
17
|
+
* §6.6 the signed-in user's own live token at a connected provider — the
|
|
18
|
+
* `user.getToken({ provider })` equivalent. Always the caller's own token
|
|
19
|
+
* (the server keys off the session), refreshed on read if stale, and never
|
|
20
|
+
* the refresh token.
|
|
21
|
+
*/
|
|
22
|
+
getProviderToken(provider: string): Promise<ProviderToken | null>;
|
|
23
|
+
};
|
|
24
|
+
export declare function useSession(): {
|
|
25
|
+
isLoaded: boolean;
|
|
26
|
+
session: AtlasSession | null;
|
|
27
|
+
};
|
|
28
|
+
export declare function useAuth(): {
|
|
29
|
+
isLoaded: boolean;
|
|
30
|
+
isSignedIn: boolean;
|
|
31
|
+
userId: string | null;
|
|
32
|
+
sessionId: string | null;
|
|
33
|
+
orgId: string | null;
|
|
34
|
+
orgRole: string | null;
|
|
35
|
+
/** Always fresh: refreshes first if the cached token is close to expiry. */
|
|
36
|
+
getToken: () => Promise<string | null>;
|
|
37
|
+
/** §6.6 the user's own live access token at a connected social provider. */
|
|
38
|
+
getProviderToken: (provider: string) => Promise<ProviderToken | null>;
|
|
39
|
+
signOut: () => Promise<void>;
|
|
40
|
+
/** Mirrors <Protect>, for logic that is not a render decision. */
|
|
41
|
+
has: (condition: ProtectCondition) => boolean;
|
|
42
|
+
};
|
|
43
|
+
export declare function useOrganization(): {
|
|
44
|
+
isLoaded: boolean;
|
|
45
|
+
organization: AtlasOrganizationMembership['organization'] | null;
|
|
46
|
+
membership: AtlasOrganizationMembership | null;
|
|
47
|
+
memberships: AtlasOrganizationMembership[];
|
|
48
|
+
setActive(organizationId: string | null): Promise<void>;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Cross-property silent auth (P3). Runs the hidden-iframe OIDC `prompt=none`
|
|
52
|
+
* check ({@link checkSession}) once on mount and reports whether the visitor is
|
|
53
|
+
* already signed in on this Atlas instance — for a pure client-side UI decision
|
|
54
|
+
* ("show Sign in" vs "show account"), never as a security boundary. Pass `null`
|
|
55
|
+
* to skip the check (e.g. until config is ready). `signedIn` is `null` while the
|
|
56
|
+
* check is in flight or skipped, then a boolean.
|
|
57
|
+
*/
|
|
58
|
+
export declare function useSilentAuth(options: CheckSessionOptions | null): {
|
|
59
|
+
loading: boolean;
|
|
60
|
+
signedIn: boolean | null;
|
|
61
|
+
error?: string;
|
|
62
|
+
};
|
package/dist/hooks.js
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useUser = useUser;
|
|
4
|
+
exports.useSession = useSession;
|
|
5
|
+
exports.useAuth = useAuth;
|
|
6
|
+
exports.useOrganization = useOrganization;
|
|
7
|
+
exports.useSilentAuth = useSilentAuth;
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
const js_1 = require("@atlasauth/js");
|
|
10
|
+
const AtlasProvider_1 = require("./AtlasProvider");
|
|
11
|
+
const protect_1 = require("./protect");
|
|
12
|
+
/**
|
|
13
|
+
* §10.1 hooks.
|
|
14
|
+
*
|
|
15
|
+
* Every one returns `isLoaded` alongside its data, and that is not ceremony.
|
|
16
|
+
* Without it a component cannot tell "still booting" from "signed out", so it
|
|
17
|
+
* renders a sign-in form for a fraction of a second on every page load — the
|
|
18
|
+
* flash of unauthenticated content that makes an app feel broken.
|
|
19
|
+
*/
|
|
20
|
+
function useUser() {
|
|
21
|
+
const { status, user, getProviderToken } = (0, AtlasProvider_1.useAtlas)();
|
|
22
|
+
return {
|
|
23
|
+
isLoaded: status !== 'loading',
|
|
24
|
+
isSignedIn: status === 'signed_in',
|
|
25
|
+
user,
|
|
26
|
+
getProviderToken,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
function useSession() {
|
|
30
|
+
const { status, session } = (0, AtlasProvider_1.useAtlas)();
|
|
31
|
+
return { isLoaded: status !== 'loading', session };
|
|
32
|
+
}
|
|
33
|
+
function useAuth() {
|
|
34
|
+
const { status, claims, getToken, getProviderToken, signOut } = (0, AtlasProvider_1.useAtlas)();
|
|
35
|
+
return {
|
|
36
|
+
isLoaded: status !== 'loading',
|
|
37
|
+
isSignedIn: status === 'signed_in',
|
|
38
|
+
userId: claims?.sub ?? null,
|
|
39
|
+
sessionId: claims?.sid ?? null,
|
|
40
|
+
orgId: claims?.org_id ?? null,
|
|
41
|
+
orgRole: claims?.org_role ?? null,
|
|
42
|
+
/** Always fresh: refreshes first if the cached token is close to expiry. */
|
|
43
|
+
getToken,
|
|
44
|
+
/** §6.6 the user's own live access token at a connected social provider. */
|
|
45
|
+
getProviderToken,
|
|
46
|
+
signOut,
|
|
47
|
+
/** Mirrors <Protect>, for logic that is not a render decision. */
|
|
48
|
+
has: (condition) => (0, protect_1.evaluate)(claims, condition).allowed,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function useOrganization() {
|
|
52
|
+
const { status, claims, memberships, setActiveOrganization } = (0, AtlasProvider_1.useAtlas)();
|
|
53
|
+
const active = memberships.find((m) => m.organization.id === claims?.org_id) ?? null;
|
|
54
|
+
return {
|
|
55
|
+
isLoaded: status !== 'loading',
|
|
56
|
+
organization: active?.organization ?? null,
|
|
57
|
+
membership: active,
|
|
58
|
+
memberships,
|
|
59
|
+
setActive: setActiveOrganization,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Cross-property silent auth (P3). Runs the hidden-iframe OIDC `prompt=none`
|
|
64
|
+
* check ({@link checkSession}) once on mount and reports whether the visitor is
|
|
65
|
+
* already signed in on this Atlas instance — for a pure client-side UI decision
|
|
66
|
+
* ("show Sign in" vs "show account"), never as a security boundary. Pass `null`
|
|
67
|
+
* to skip the check (e.g. until config is ready). `signedIn` is `null` while the
|
|
68
|
+
* check is in flight or skipped, then a boolean.
|
|
69
|
+
*/
|
|
70
|
+
function useSilentAuth(options) {
|
|
71
|
+
const [state, setState] = (0, react_1.useState)({
|
|
72
|
+
loading: options !== null,
|
|
73
|
+
signedIn: null,
|
|
74
|
+
});
|
|
75
|
+
// Re-run only when the meaningful inputs change, not on every render.
|
|
76
|
+
const key = options
|
|
77
|
+
? [options.issuer, options.clientId, options.redirectUri, options.idTokenHint ?? ''].join('|')
|
|
78
|
+
: null;
|
|
79
|
+
(0, react_1.useEffect)(() => {
|
|
80
|
+
if (!options) {
|
|
81
|
+
setState({ loading: false, signedIn: null });
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
let active = true;
|
|
85
|
+
setState((s) => ({ ...s, loading: true }));
|
|
86
|
+
void (0, js_1.checkSession)(options).then((r) => {
|
|
87
|
+
if (active)
|
|
88
|
+
setState({ loading: false, signedIn: r.signedIn, error: r.error });
|
|
89
|
+
});
|
|
90
|
+
return () => {
|
|
91
|
+
active = false;
|
|
92
|
+
};
|
|
93
|
+
}, [key]);
|
|
94
|
+
return state;
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=hooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":";;AAeA,0BAmBC;AAED,gCAGC;AAED,0BAiBC;AAED,0CAiBC;AAUD,sCA4BC;AAnHD,iCAA4C;AAC5C,sCA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,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC;QACjF,CAAC,CAAC,CAAC;QACH,OAAO,GAAG,EAAE;YACV,MAAM,GAAG,KAAK,CAAC;QACjB,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACV,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/dist/i18n.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* §10.3: "Every string passes through an i18n catalog; en-US ships, catalog
|
|
3
|
+
* format documented for community locales."
|
|
4
|
+
*
|
|
5
|
+
* A flat key-to-string map rather than nested objects, because nesting looks
|
|
6
|
+
* tidier and makes a missing key a runtime crash on `undefined.of.a.chain`
|
|
7
|
+
* rather than a visible fallback.
|
|
8
|
+
*
|
|
9
|
+
* A missing key renders the KEY, not an empty string. A blank button is a bug
|
|
10
|
+
* nobody can report; a button reading `signIn.submit` is one anyone can.
|
|
11
|
+
*/
|
|
12
|
+
export type Catalog = Record<string, string>;
|
|
13
|
+
export declare const EN_US: Catalog;
|
|
14
|
+
/**
|
|
15
|
+
* Look up a key and interpolate `{placeholders}`.
|
|
16
|
+
*
|
|
17
|
+
* An unknown placeholder is left visible for the same reason a missing key is:
|
|
18
|
+
* `Continue with {provider}` in the UI is a bug report waiting to be filed,
|
|
19
|
+
* whereas `Continue with ` is one nobody notices until a customer does.
|
|
20
|
+
*/
|
|
21
|
+
export declare function translate(catalog: Catalog, key: string, variables?: Record<string, string>): string;
|
|
22
|
+
/** Merge a community locale over en-US so a partial translation still renders. */
|
|
23
|
+
export declare function withFallback(locale: Catalog): Catalog;
|
package/dist/i18n.js
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* §10.3: "Every string passes through an i18n catalog; en-US ships, catalog
|
|
4
|
+
* format documented for community locales."
|
|
5
|
+
*
|
|
6
|
+
* A flat key-to-string map rather than nested objects, because nesting looks
|
|
7
|
+
* tidier and makes a missing key a runtime crash on `undefined.of.a.chain`
|
|
8
|
+
* rather than a visible fallback.
|
|
9
|
+
*
|
|
10
|
+
* A missing key renders the KEY, not an empty string. A blank button is a bug
|
|
11
|
+
* nobody can report; a button reading `signIn.submit` is one anyone can.
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.EN_US = void 0;
|
|
15
|
+
exports.translate = translate;
|
|
16
|
+
exports.withFallback = withFallback;
|
|
17
|
+
exports.EN_US = {
|
|
18
|
+
'signIn.title': 'Sign in',
|
|
19
|
+
'signIn.subtitle': 'to continue to {application}',
|
|
20
|
+
'signIn.identifierLabel': 'Email address',
|
|
21
|
+
'signIn.passwordLabel': 'Password',
|
|
22
|
+
'signIn.submit': 'Continue',
|
|
23
|
+
'signIn.forgotPassword': 'Forgot password?',
|
|
24
|
+
'signIn.noAccount': 'No account?',
|
|
25
|
+
'signIn.signUpLink': 'Sign up',
|
|
26
|
+
'signIn.orDivider': 'or',
|
|
27
|
+
'signIn.socialButton': 'Continue with {provider}',
|
|
28
|
+
'signIn.emailCodeLabel': 'Verification code',
|
|
29
|
+
'signIn.magicLinkSent': 'Check your email for a sign-in link.',
|
|
30
|
+
'signIn.checkOtherTab': 'You can close this tab — you are signed in where you started.',
|
|
31
|
+
'signUp.title': 'Create your account',
|
|
32
|
+
'signUp.submit': 'Continue',
|
|
33
|
+
'signUp.haveAccount': 'Already have an account?',
|
|
34
|
+
'signUp.signInLink': 'Sign in',
|
|
35
|
+
'mfa.title': 'Two-step verification',
|
|
36
|
+
'mfa.subtitle': 'Enter the code from your authenticator app.',
|
|
37
|
+
'mfa.codeLabel': 'Code',
|
|
38
|
+
'mfa.enrollFirstCodeLabel': 'Code from your authenticator app',
|
|
39
|
+
'mfa.enrollSecondCodeLabel': 'The next code it shows',
|
|
40
|
+
'mfa.usePasskey': 'Use a passkey instead',
|
|
41
|
+
'mfa.useBackupCode': 'Use a recovery code',
|
|
42
|
+
'mfa.submit': 'Verify',
|
|
43
|
+
'reset.title': 'Reset your password',
|
|
44
|
+
'reset.submit': 'Send reset code',
|
|
45
|
+
'reset.newPasswordLabel': 'New password',
|
|
46
|
+
'userButton.manageAccount': 'Manage account',
|
|
47
|
+
'userButton.signOut': 'Sign out',
|
|
48
|
+
'userButton.signOutAll': 'Sign out of all devices',
|
|
49
|
+
'userProfile.title': 'Account',
|
|
50
|
+
'userProfile.profileSection': 'Profile',
|
|
51
|
+
'userProfile.emailsSection': 'Email addresses',
|
|
52
|
+
'userProfile.securitySection': 'Security',
|
|
53
|
+
'userProfile.devicesSection': 'Active devices',
|
|
54
|
+
'userProfile.dangerSection': 'Danger zone',
|
|
55
|
+
'userProfile.addEmail': 'Add an email address',
|
|
56
|
+
'userProfile.makePrimary': 'Make primary',
|
|
57
|
+
'userProfile.unverified': 'Unverified',
|
|
58
|
+
'userProfile.revokeDevice': 'Sign out',
|
|
59
|
+
'userProfile.deleteAccount': 'Delete account',
|
|
60
|
+
'organization.switcher': 'Switch organization',
|
|
61
|
+
'organization.personal': 'Personal account',
|
|
62
|
+
'organization.members': 'Members',
|
|
63
|
+
'organization.invite': 'Invite member',
|
|
64
|
+
'organization.roleLabel': 'Role',
|
|
65
|
+
'error.generic': 'Something went wrong. Please try again.',
|
|
66
|
+
'error.network': 'We could not reach the server. Check your connection.',
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Look up a key and interpolate `{placeholders}`.
|
|
70
|
+
*
|
|
71
|
+
* An unknown placeholder is left visible for the same reason a missing key is:
|
|
72
|
+
* `Continue with {provider}` in the UI is a bug report waiting to be filed,
|
|
73
|
+
* whereas `Continue with ` is one nobody notices until a customer does.
|
|
74
|
+
*/
|
|
75
|
+
function translate(catalog, key, variables = {}) {
|
|
76
|
+
const template = catalog[key] ?? exports.EN_US[key] ?? key;
|
|
77
|
+
return template.replace(/\{(\w+)\}/g, (match, name) => variables[name] ?? match);
|
|
78
|
+
}
|
|
79
|
+
/** Merge a community locale over en-US so a partial translation still renders. */
|
|
80
|
+
function withFallback(locale) {
|
|
81
|
+
return { ...exports.EN_US, ...locale };
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=i18n.js.map
|
package/dist/i18n.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../src/i18n.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAsEH,8BAOC;AAGD,oCAEC;AA9EY,QAAA,KAAK,GAAY;IAC5B,cAAc,EAAE,SAAS;IACzB,iBAAiB,EAAE,8BAA8B;IACjD,wBAAwB,EAAE,eAAe;IACzC,sBAAsB,EAAE,UAAU;IAClC,eAAe,EAAE,UAAU;IAC3B,uBAAuB,EAAE,kBAAkB;IAC3C,kBAAkB,EAAE,aAAa;IACjC,mBAAmB,EAAE,SAAS;IAC9B,kBAAkB,EAAE,IAAI;IACxB,qBAAqB,EAAE,0BAA0B;IACjD,uBAAuB,EAAE,mBAAmB;IAC5C,sBAAsB,EAAE,sCAAsC;IAC9D,sBAAsB,EAAE,+DAA+D;IAEvF,cAAc,EAAE,qBAAqB;IACrC,eAAe,EAAE,UAAU;IAC3B,oBAAoB,EAAE,0BAA0B;IAChD,mBAAmB,EAAE,SAAS;IAE9B,WAAW,EAAE,uBAAuB;IACpC,cAAc,EAAE,6CAA6C;IAC7D,eAAe,EAAE,MAAM;IACvB,0BAA0B,EAAE,kCAAkC;IAC9D,2BAA2B,EAAE,wBAAwB;IACrD,gBAAgB,EAAE,uBAAuB;IACzC,mBAAmB,EAAE,qBAAqB;IAC1C,YAAY,EAAE,QAAQ;IAEtB,aAAa,EAAE,qBAAqB;IACpC,cAAc,EAAE,iBAAiB;IACjC,wBAAwB,EAAE,cAAc;IAExC,0BAA0B,EAAE,gBAAgB;IAC5C,oBAAoB,EAAE,UAAU;IAChC,uBAAuB,EAAE,yBAAyB;IAElD,mBAAmB,EAAE,SAAS;IAC9B,4BAA4B,EAAE,SAAS;IACvC,2BAA2B,EAAE,iBAAiB;IAC9C,6BAA6B,EAAE,UAAU;IACzC,4BAA4B,EAAE,gBAAgB;IAC9C,2BAA2B,EAAE,aAAa;IAC1C,sBAAsB,EAAE,sBAAsB;IAC9C,yBAAyB,EAAE,cAAc;IACzC,wBAAwB,EAAE,YAAY;IACtC,0BAA0B,EAAE,UAAU;IACtC,2BAA2B,EAAE,gBAAgB;IAE7C,uBAAuB,EAAE,qBAAqB;IAC9C,uBAAuB,EAAE,kBAAkB;IAC3C,sBAAsB,EAAE,SAAS;IACjC,qBAAqB,EAAE,eAAe;IACtC,wBAAwB,EAAE,MAAM;IAEhC,eAAe,EAAE,yCAAyC;IAC1D,eAAe,EAAE,uDAAuD;CACzE,CAAC;AAEF;;;;;;GAMG;AACH,SAAgB,SAAS,CACvB,OAAgB,EAChB,GAAW,EACX,YAAoC,EAAE;IAEtC,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,aAAK,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC;IACnD,OAAO,QAAQ,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC,KAAK,EAAE,IAAY,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,CAAC;AAC3F,CAAC;AAED,kFAAkF;AAClF,SAAgB,YAAY,CAAC,MAAe;IAC1C,OAAO,EAAE,GAAG,aAAK,EAAE,GAAG,MAAM,EAAE,CAAC;AACjC,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './appearance';
|
|
2
|
+
export * from './protect';
|
|
3
|
+
export * from './i18n';
|
|
4
|
+
export * from './types';
|
|
5
|
+
export * from './AtlasProvider';
|
|
6
|
+
export * from './hooks';
|
|
7
|
+
export * from './fapi';
|
|
8
|
+
export * from './components';
|
|
9
|
+
export { checkSession, handleSilentCallback } from '@atlasauth/js';
|
|
10
|
+
export type { CheckSessionOptions, CheckSessionResult } from '@atlasauth/js';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.handleSilentCallback = exports.checkSession = void 0;
|
|
18
|
+
__exportStar(require("./appearance"), exports);
|
|
19
|
+
__exportStar(require("./protect"), exports);
|
|
20
|
+
__exportStar(require("./i18n"), exports);
|
|
21
|
+
__exportStar(require("./types"), exports);
|
|
22
|
+
__exportStar(require("./AtlasProvider"), exports);
|
|
23
|
+
__exportStar(require("./hooks"), exports);
|
|
24
|
+
__exportStar(require("./fapi"), exports);
|
|
25
|
+
__exportStar(require("./components"), exports);
|
|
26
|
+
// Cross-property SSO: the browser silent-check (hidden-iframe OIDC prompt=none),
|
|
27
|
+
// surfaced first-class here from @atlasauth/js.
|
|
28
|
+
var js_1 = require("@atlasauth/js");
|
|
29
|
+
Object.defineProperty(exports, "checkSession", { enumerable: true, get: function () { return js_1.checkSession; } });
|
|
30
|
+
Object.defineProperty(exports, "handleSilentCallback", { enumerable: true, get: function () { return js_1.handleSilentCallback; } });
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,4CAA0B;AAC1B,yCAAuB;AACvB,0CAAwB;AACxB,kDAAgC;AAChC,0CAAwB;AACxB,yCAAuB;AACvB,+CAA6B;AAC7B,iFAAiF;AACjF,gDAAgD;AAChD,oCAAmE;AAA1D,kGAAA,YAAY,OAAA;AAAE,0GAAA,oBAAoB,OAAA"}
|