@atlasauth/react 0.13.0 → 0.14.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/billing.js CHANGED
@@ -63,6 +63,7 @@ function useBilling(opts = {}) {
63
63
  org_id: params.orgId ?? orgId,
64
64
  success_url: params.successUrl ?? (0, components_shared_1.currentUrl)(),
65
65
  cancel_url: params.cancelUrl ?? (0, components_shared_1.currentUrl)(),
66
+ ...(params.interval ? { interval: params.interval } : {}),
66
67
  });
67
68
  if (res.ok && res.data?.url && params.redirect !== false)
68
69
  (0, components_shared_1.navigateTo)(res.data.url);
@@ -77,7 +78,38 @@ function useBilling(opts = {}) {
77
78
  (0, components_shared_1.navigateTo)(res.data.url);
78
79
  return res;
79
80
  }, [client, orgId]);
80
- return { isLoaded, plans, subscription, invoices, paymentMethod, checkout, openPortal, reload };
81
+ /** Switch the live subscription to another plan or interval (no checkout needed). */
82
+ const changePlan = (0, react_1.useCallback)(async (params) => {
83
+ const res = await client.post('/v1/client/billing/subscription/change', {
84
+ plan_id: params.planId,
85
+ org_id: params.orgId ?? orgId,
86
+ ...(params.interval ? { interval: params.interval } : {}),
87
+ schedule_at_period_end: params.atPeriodEnd === true,
88
+ });
89
+ if (res.ok)
90
+ await reload();
91
+ return res;
92
+ }, [client, orgId, reload]);
93
+ /** Cancel at the end of the period (default), or now with `{ immediately: true }`. */
94
+ const cancel = (0, react_1.useCallback)(async (params = {}) => {
95
+ const res = await client.post('/v1/client/billing/subscription/cancel', {
96
+ org_id: params.orgId ?? orgId,
97
+ immediately: params.immediately === true,
98
+ });
99
+ if (res.ok)
100
+ await reload();
101
+ return res;
102
+ }, [client, orgId, reload]);
103
+ /** Undo a cancellation scheduled for the end of the period. */
104
+ const restore = (0, react_1.useCallback)(async (params = {}) => {
105
+ const res = await client.post('/v1/client/billing/subscription/restore', {
106
+ org_id: params.orgId ?? orgId,
107
+ });
108
+ if (res.ok)
109
+ await reload();
110
+ return res;
111
+ }, [client, orgId, reload]);
112
+ return { isLoaded, plans, subscription, invoices, paymentMethod, checkout, openPortal, changePlan, cancel, restore, reload };
81
113
  }
82
114
  /** §commerce Clerk-parity alias — just the `checkout` action from {@link useBilling}. */
83
115
  function useCheckout(opts = {}) {
@@ -86,8 +118,8 @@ function useCheckout(opts = {}) {
86
118
  }
87
119
  /** §commerce Clerk-parity alias — the subject's subscription from {@link useBilling}. */
88
120
  function useSubscription(opts = {}) {
89
- const { isLoaded, subscription, openPortal, reload } = useBilling(opts);
90
- return { isLoaded, subscription, openPortal, reload };
121
+ const { isLoaded, subscription, openPortal, changePlan, cancel, restore, reload } = useBilling(opts);
122
+ return { isLoaded, subscription, openPortal, changePlan, cancel, restore, reload };
91
123
  }
92
124
  /** §commerce Clerk-parity alias — the subject's invoices from {@link useBilling}. */
93
125
  function useInvoices(opts = {}) {
@@ -115,7 +147,7 @@ function formatPrice(amount, currency) {
115
147
  * disabled and an "Manage billing" action opens the Billing Portal instead).
116
148
  */
117
149
  function PricingTable({ orgId } = {}) {
118
- const { isLoaded, plans, subscription, checkout, openPortal } = useBilling({ orgId });
150
+ const { isLoaded, plans, subscription, checkout, openPortal, changePlan } = useBilling({ orgId });
119
151
  const { status } = (0, AtlasProvider_1.useAtlas)();
120
152
  const t = (0, components_shared_1.useText)();
121
153
  const cardClass = (0, components_shared_1.useClass)('card', 'atlas-card');
@@ -123,13 +155,16 @@ function PricingTable({ orgId } = {}) {
123
155
  const cls = (0, components_shared_1.useClasses)();
124
156
  const [busyPlan, setBusyPlan] = (0, react_1.useState)(null);
125
157
  const currentPlanId = subscription?.plan?.id ?? null;
158
+ // A subject with a live subscription switches plans in place (prorated) instead of a second checkout.
159
+ const live = ['active', 'trialing', 'past_due'].includes(String(subscription?.status ?? ''));
126
160
  if (!isLoaded)
127
161
  return (0, jsx_runtime_1.jsx)("div", { "data-atlas": "pricing-table", "aria-busy": "true" });
128
162
  return ((0, jsx_runtime_1.jsx)("div", { className: cls('pricingTable', 'atlas-pricing-table'), "data-atlas": "pricing-table", children: plans.map((plan) => {
129
163
  const isCurrent = plan.id === currentPlanId;
130
164
  return ((0, jsx_runtime_1.jsxs)("div", { className: cardClass, "data-atlas": "pricing-plan", "data-current": isCurrent, children: [(0, jsx_runtime_1.jsx)("h3", { className: cls('planName', 'atlas-plan-name'), children: plan.name }), (0, jsx_runtime_1.jsxs)("p", { className: cls('price', 'atlas-price'), children: [formatPrice(plan.amount, plan.currency), (0, jsx_runtime_1.jsxs)("span", { className: cls('priceInterval', 'atlas-interval'), children: [" / ", plan.interval] })] }), plan.features.length ? ((0, jsx_runtime_1.jsx)("ul", { className: cls('list', 'atlas-list'), children: plan.features.map((f, i) => ((0, jsx_runtime_1.jsx)("li", { className: cls('listItem', 'atlas-list-item'), children: f }, i))) })) : null, isCurrent ? ((0, jsx_runtime_1.jsx)("button", { type: "button", className: buttonClass, "data-atlas": "manage-billing", onClick: () => void openPortal(), children: t('commerce.manage') })) : ((0, jsx_runtime_1.jsx)("button", { type: "button", className: buttonClass, disabled: status !== 'signed_in' || busyPlan === plan.id, onClick: () => {
131
165
  setBusyPlan(plan.id);
132
- void checkout({ planId: plan.id }).finally(() => setBusyPlan(null));
166
+ const action = live && currentPlanId ? changePlan({ planId: plan.id }) : checkout({ planId: plan.id });
167
+ void action.finally(() => setBusyPlan(null));
133
168
  }, children: t('commerce.subscribe') }))] }, plan.id));
134
169
  }) }));
135
170
  }
@@ -1 +1 @@
1
- {"version":3,"file":"billing.js","sourceRoot":"","sources":["../src/billing.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;AAwCb,gCAoEC;AAGD,kCAGC;AAGD,0CAGC;AAGD,kCAGC;AAGD,8CAGC;AAiBD,oCA2DC;AAOD,4BA+BC;AA2BD,4CAqGC;;AApXD,iCAAiF;AACjF,mDAA2C;AAC3C,2DAAuH;AA8BvH;;;;;GAKG;AACH,SAAgB,UAAU,CAAC,OAA2B,EAAE;IACtD,MAAM,EAAE,MAAM,EAAE,GAA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
23
23
  export { UserButton, UserAvatar } from './user-button';
24
24
  export type { AuthButtonProps } from './auth-buttons';
25
25
  export { SignInButton, SignUpButton, SignOutButton, RedirectToSignIn, RedirectToSignUp, } from './auth-buttons';
26
- export { OrganizationSwitcher, useOrganizationList, CreateOrganization, OrganizationList, OrganizationProfile, } from './organization';
26
+ export { OrganizationSwitcher, useOrganizationList, CreateOrganization, OrganizationList, OrganizationProfile, OrganizationAuditLog, useOrganizationAuditLog, useOrganizationProfile, } from './organization';
27
+ export type { OrganizationAuditLogEntry } from './organization';
28
+ export type { OrganizationProfileProps } from './organization';
27
29
  export type { ProfilePageProps, ProfileLinkProps } from './account';
28
- export { ActiveSessions, ProfileCard, ManageMfa, ManagePasskeys, UserProfile, } from './account';
30
+ export { ActiveSessions, ProfileCard, ManageMfa, ManagePasskeys, ManagePhoneNumbers, UserProfile, } from './account';
29
31
  export { useWaitlist, Waitlist } from './waitlist';
30
- export { useReverification } from './reverification';
32
+ export { ImpersonationBanner, useImpersonation } from './impersonation';
33
+ export type { ImpersonationBannerProps, UseImpersonationReturn } from './impersonation';
34
+ export { useReverification, ReverificationPrompt, isReverificationCancelled, type Reverification } from './reverification';
31
35
  export type { ApiKeysProps, ApiKeysStatus, ApiKeyClaimsFieldsContext, UseApiKeysResult, CreateUserApiKeyInput, CreatedUserApiKey, UserApiKey, } from './api-keys';
32
36
  export { ApiKeys, useApiKeys } from './api-keys';
33
37
  export type { CheckoutParams } from './billing';
@@ -17,7 +17,7 @@
17
17
  * @atlasauth/js. See `flow.tsx` for that shell.
18
18
  */
19
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
- exports.EmbeddedCheckout = exports.Invoices = exports.PricingTable = exports.usePaymentMethods = exports.useInvoices = exports.useSubscription = exports.useCheckout = exports.useBilling = exports.useApiKeys = exports.ApiKeys = exports.useReverification = exports.Waitlist = exports.useWaitlist = exports.UserProfile = exports.ManagePasskeys = exports.ManageMfa = exports.ProfileCard = exports.ActiveSessions = exports.OrganizationProfile = exports.OrganizationList = exports.CreateOrganization = exports.useOrganizationList = exports.OrganizationSwitcher = exports.RedirectToSignUp = exports.RedirectToSignIn = exports.SignOutButton = exports.SignUpButton = exports.SignInButton = exports.UserAvatar = exports.UserButton = exports.useSignUp = exports.SignUp = exports.useSignIn = exports.SocialSignInButton = exports.SignIn = exports.MultisessionAppSupport = exports.Protect = exports.AtlasLoaded = exports.AtlasLoading = exports.SignedOut = exports.SignedIn = void 0;
20
+ exports.EmbeddedCheckout = exports.Invoices = exports.PricingTable = exports.usePaymentMethods = exports.useInvoices = exports.useSubscription = exports.useCheckout = exports.useBilling = exports.useApiKeys = exports.ApiKeys = exports.isReverificationCancelled = exports.ReverificationPrompt = exports.useReverification = exports.useImpersonation = exports.ImpersonationBanner = exports.Waitlist = exports.useWaitlist = exports.UserProfile = exports.ManagePhoneNumbers = exports.ManagePasskeys = exports.ManageMfa = exports.ProfileCard = exports.ActiveSessions = exports.useOrganizationProfile = exports.useOrganizationAuditLog = exports.OrganizationAuditLog = exports.OrganizationProfile = exports.OrganizationList = exports.CreateOrganization = exports.useOrganizationList = exports.OrganizationSwitcher = exports.RedirectToSignUp = exports.RedirectToSignIn = exports.SignOutButton = exports.SignUpButton = exports.SignInButton = exports.UserAvatar = exports.UserButton = exports.useSignUp = exports.SignUp = exports.useSignIn = exports.SocialSignInButton = exports.SignIn = exports.MultisessionAppSupport = exports.Protect = exports.AtlasLoaded = exports.AtlasLoading = exports.SignedOut = exports.SignedIn = void 0;
21
21
  // Control / conditional-rendering components.
22
22
  var control_components_1 = require("./control-components");
23
23
  Object.defineProperty(exports, "SignedIn", { enumerable: true, get: function () { return control_components_1.SignedIn; } });
@@ -49,19 +49,29 @@ Object.defineProperty(exports, "useOrganizationList", { enumerable: true, get: f
49
49
  Object.defineProperty(exports, "CreateOrganization", { enumerable: true, get: function () { return organization_1.CreateOrganization; } });
50
50
  Object.defineProperty(exports, "OrganizationList", { enumerable: true, get: function () { return organization_1.OrganizationList; } });
51
51
  Object.defineProperty(exports, "OrganizationProfile", { enumerable: true, get: function () { return organization_1.OrganizationProfile; } });
52
+ Object.defineProperty(exports, "OrganizationAuditLog", { enumerable: true, get: function () { return organization_1.OrganizationAuditLog; } });
53
+ Object.defineProperty(exports, "useOrganizationAuditLog", { enumerable: true, get: function () { return organization_1.useOrganizationAuditLog; } });
54
+ Object.defineProperty(exports, "useOrganizationProfile", { enumerable: true, get: function () { return organization_1.useOrganizationProfile; } });
52
55
  var account_1 = require("./account");
53
56
  Object.defineProperty(exports, "ActiveSessions", { enumerable: true, get: function () { return account_1.ActiveSessions; } });
54
57
  Object.defineProperty(exports, "ProfileCard", { enumerable: true, get: function () { return account_1.ProfileCard; } });
55
58
  Object.defineProperty(exports, "ManageMfa", { enumerable: true, get: function () { return account_1.ManageMfa; } });
56
59
  Object.defineProperty(exports, "ManagePasskeys", { enumerable: true, get: function () { return account_1.ManagePasskeys; } });
60
+ Object.defineProperty(exports, "ManagePhoneNumbers", { enumerable: true, get: function () { return account_1.ManagePhoneNumbers; } });
57
61
  Object.defineProperty(exports, "UserProfile", { enumerable: true, get: function () { return account_1.UserProfile; } });
58
62
  // Waitlist.
59
63
  var waitlist_1 = require("./waitlist");
60
64
  Object.defineProperty(exports, "useWaitlist", { enumerable: true, get: function () { return waitlist_1.useWaitlist; } });
61
65
  Object.defineProperty(exports, "Waitlist", { enumerable: true, get: function () { return waitlist_1.Waitlist; } });
66
+ // Impersonation: the banner with "Return to admin", and its hook.
67
+ var impersonation_1 = require("./impersonation");
68
+ Object.defineProperty(exports, "ImpersonationBanner", { enumerable: true, get: function () { return impersonation_1.ImpersonationBanner; } });
69
+ Object.defineProperty(exports, "useImpersonation", { enumerable: true, get: function () { return impersonation_1.useImpersonation; } });
62
70
  // Step-up reverification.
63
71
  var reverification_1 = require("./reverification");
64
72
  Object.defineProperty(exports, "useReverification", { enumerable: true, get: function () { return reverification_1.useReverification; } });
73
+ Object.defineProperty(exports, "ReverificationPrompt", { enumerable: true, get: function () { return reverification_1.ReverificationPrompt; } });
74
+ Object.defineProperty(exports, "isReverificationCancelled", { enumerable: true, get: function () { return reverification_1.isReverificationCancelled; } });
65
75
  var api_keys_1 = require("./api-keys");
66
76
  Object.defineProperty(exports, "ApiKeys", { enumerable: true, get: function () { return api_keys_1.ApiKeys; } });
67
77
  Object.defineProperty(exports, "useApiKeys", { enumerable: true, get: function () { return api_keys_1.useApiKeys; } });
@@ -1 +1 @@
1
- {"version":3,"file":"components.js","sourceRoot":"","sources":["../src/components.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;AAEH,8CAA8C;AAC9C,2DAO8B;AAN5B,8GAAA,QAAQ,OAAA;AACR,+GAAA,SAAS,OAAA;AACT,kHAAA,YAAY,OAAA;AACZ,iHAAA,WAAW,OAAA;AACX,6GAAA,OAAO,OAAA;AACP,4HAAA,sBAAsB,OAAA;AAKxB,qCAAkE;AAAzD,iGAAA,MAAM,OAAA;AAAE,6GAAA,kBAAkB,OAAA;AAAE,oGAAA,SAAS,OAAA;AAC9C,qCAA8C;AAArC,iGAAA,MAAM,OAAA;AAAE,oGAAA,SAAS,OAAA;AAI1B,6CAAuD;AAA9C,yGAAA,UAAU,OAAA;AAAE,yGAAA,UAAU,OAAA;AAI/B,+CAMwB;AALtB,4GAAA,YAAY,OAAA;AACZ,4GAAA,YAAY,OAAA;AACZ,6GAAA,aAAa,OAAA;AACb,gHAAA,gBAAgB,OAAA;AAChB,gHAAA,gBAAgB,OAAA;AAGlB,iBAAiB;AACjB,+CAMwB;AALtB,oHAAA,oBAAoB,OAAA;AACpB,mHAAA,mBAAmB,OAAA;AACnB,kHAAA,kBAAkB,OAAA;AAClB,gHAAA,gBAAgB,OAAA;AAChB,mHAAA,mBAAmB,OAAA;AAKrB,qCAMmB;AALjB,yGAAA,cAAc,OAAA;AACd,sGAAA,WAAW,OAAA;AACX,oGAAA,SAAS,OAAA;AACT,yGAAA,cAAc,OAAA;AACd,sGAAA,WAAW,OAAA;AAGb,Y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OAAA;AACnB,oHAAA,oBAAoB,OAAA;AACpB,uHAAA,uBAAuB,OAAA;AACvB,sHAAA,sBAAsB,OAAA;AAOxB,qCAOmB;AANjB,yGAAA,cAAc,OAAA;AACd,sGAAA,WAAW,OAAA;AACX,oGAAA,SAAS,OAAA;AACT,yGAAA,cAAc,OAAA;AACd,6GAAA,kBAAkB,OAAA;AAClB,sGAAA,WAAW,OAAA;AAGb,YAAY;AACZ,uCAAmD;AAA1C,uGAAA,WAAW,OAAA;AAAE,oGAAA,QAAQ,OAAA;AAE9B,kEAAkE;AAClE,iDAAwE;AAA/D,oHAAA,mBAAmB,OAAA;AAAE,iHAAA,gBAAgB,OAAA;AAG9C,0BAA0B;AAC1B,mDAA2H;AAAlH,mHAAA,iBAAiB,OAAA;AAAE,sHAAA,oBAAoB,OAAA;AAAE,2HAAA,yBAAyB,OAAA;AAY3E,uCAAiD;AAAxC,mGAAA,OAAO,OAAA;AAAE,sGAAA,UAAU,OAAA;AAI5B,qCASmB;AARjB,qGAAA,UAAU,OAAA;AACV,sGAAA,WAAW,OAAA;AACX,0GAAA,eAAe,OAAA;AACf,sGAAA,WAAW,OAAA;AACX,4GAAA,iBAAiB,OAAA;AACjB,uGAAA,YAAY,OAAA;AACZ,mGAAA,QAAQ,OAAA;AACR,2GAAA,gBAAgB,OAAA"}
package/dist/flow.d.ts CHANGED
@@ -93,7 +93,7 @@ export interface FlowProps {
93
93
  * Every branch comes from `nextStep`, which is exhaustive — including the
94
94
  * `unknown` case, which renders an honest message instead of nothing.
95
95
  */
96
- export declare function AttemptFlow({ attempt, onSubmit, busy, errors, titleKey, hideTitle, captcha, prepared, onPrepare, onUsePassword, sessionKept, }: {
96
+ export declare function AttemptFlow({ attempt, onSubmit, busy, errors, titleKey, hideTitle, captcha, prepared, onPrepare, onUsePassword, sessionKept, recoveryCodes, onRecoveryCodesSaved, }: {
97
97
  attempt: AttemptView | null;
98
98
  onSubmit(values: Record<string, string>): void;
99
99
  busy: boolean;
@@ -120,6 +120,13 @@ export declare function AttemptFlow({ attempt, onSubmit, busy, errors, titleKey,
120
120
  onUsePassword?(): void;
121
121
  /** `FlowState.sessionKept`: whether this browser kept the session the sign-in created. */
122
122
  sessionKept?: boolean;
123
+ /**
124
+ * The recovery codes an MFA enrolment just completed the sign-in with
125
+ * (`pendingRecoveryCodes(state)`): drawn once instead of the form, and
126
+ * "I've saved my codes" calls {@link onRecoveryCodesSaved} to finish.
127
+ */
128
+ recoveryCodes?: string[] | null;
129
+ onRecoveryCodesSaved?(): void;
123
130
  }): import("react").JSX.Element;
124
131
  /**
125
132
  * §10.2 `FlowProps.afterUrl` — the completion-redirect decision, pulled out as a
@@ -159,6 +166,7 @@ export declare function useFlow({ afterUrl, signInCaptcha, referral, referralCon
159
166
  captcha: import("./captcha").CaptchaController;
160
167
  prepare: (strategy: EmailFactor) => void;
161
168
  usePassword: () => void;
169
+ saveRecoveryCodes: () => void;
162
170
  };
163
171
  /**
164
172
  * A social provider as it appears in `/v1/client/environment`.
@@ -313,15 +321,21 @@ export declare function AtlasSsoButton({ onClick, className, labelClassName, }:
313
321
  labelClassName?: string;
314
322
  }): import("react").JSX.Element;
315
323
  /**
316
- * §6 all enabled social sign-in providers, native-first.
317
- *
318
- * A provider with an in-page native flow (Google today) renders its secretless
319
- * button — no redirect, no new tab, no stranded initiating tab. Every OTHER
320
- * enabled provider (GitHub, Microsoft, Discord, …) renders a redirect button that
321
- * starts the OAuth flow and returns to THIS page, where `<AtlasProvider>` exchanges
322
- * the returned ticket for a session. Previously `<SignIn>` rendered only the
323
- * Google button, so an instance's other social providers never appeared.
324
+ * The method this browser last signed in with (`password`, `oauth_github`, …),
325
+ * for the "Last used" badge — null until known, when none is remembered, or
326
+ * when the instance turned the hint off.
324
327
  */
328
+ export declare function useLastSignInMethod(client: FapiClient): string | null;
329
+ /** The small "Last used" badge on a sign-in option. */
330
+ export declare function LastUsedBadge(): import("react").JSX.Element;
331
+ /**
332
+ * Above the identifier step: which first-party method (password, email code,
333
+ * passkey, phone) this browser used last. Social methods are badged on their
334
+ * own buttons instead.
335
+ */
336
+ export declare function LastUsedHint({ client }: {
337
+ client: FapiClient;
338
+ }): import("react").JSX.Element | null;
325
339
  export declare function SocialSignInButtons({ client, onComplete, oneTap, oauthMode, onProviderUnavailable, googleButton, }: {
326
340
  client: FapiClient;
327
341
  onComplete: (next: FlowState) => void | Promise<void>;
package/dist/flow.js CHANGED
@@ -10,6 +10,9 @@ exports.resolveGoogleButtonRender = resolveGoogleButtonRender;
10
10
  exports.useGoogleNativeOverlay = useGoogleNativeOverlay;
11
11
  exports.atlasSsoTarget = atlasSsoTarget;
12
12
  exports.AtlasSsoButton = AtlasSsoButton;
13
+ exports.useLastSignInMethod = useLastSignInMethod;
14
+ exports.LastUsedBadge = LastUsedBadge;
15
+ exports.LastUsedHint = LastUsedHint;
13
16
  exports.SocialSignInButtons = SocialSignInButtons;
14
17
  exports.SignUpPrompt = SignUpPrompt;
15
18
  const jsx_runtime_1 = require("react/jsx-runtime");
@@ -20,6 +23,7 @@ const fapi_1 = require("./fapi");
20
23
  const components_shared_1 = require("./components-shared");
21
24
  const captcha_1 = require("./captcha");
22
25
  const referral_1 = require("./referral");
26
+ const mfa_steps_1 = require("./mfa-steps");
23
27
  const version_1 = require("./version");
24
28
  /**
25
29
  * The server-driven flow shell.
@@ -27,7 +31,7 @@ const version_1 = require("./version");
27
31
  * Every branch comes from `nextStep`, which is exhaustive — including the
28
32
  * `unknown` case, which renders an honest message instead of nothing.
29
33
  */
30
- function AttemptFlow({ attempt, onSubmit, busy, errors, titleKey, hideTitle, captcha, prepared = null, onPrepare, onUsePassword, sessionKept, }) {
34
+ function AttemptFlow({ attempt, onSubmit, busy, errors, titleKey, hideTitle, captcha, prepared = null, onPrepare, onUsePassword, sessionKept, recoveryCodes = null, onRecoveryCodesSaved, }) {
31
35
  const t = (0, components_shared_1.useText)();
32
36
  const errorText = (0, components_shared_1.useErrorText)();
33
37
  const { instanceSettings } = (0, AtlasProvider_1.useAtlas)();
@@ -39,6 +43,10 @@ function AttemptFlow({ attempt, onSubmit, busy, errors, titleKey, hideTitle, cap
39
43
  const cls = (0, components_shared_1.useClasses)();
40
44
  const [values, setValues] = (0, react_1.useState)({});
41
45
  const step = attempt ? (0, js_1.nextStep)(attempt) : { kind: 'collect_identifier' };
46
+ // The MFA steps: what the app offers, and the enrolment step's own state.
47
+ const mfaChoices = (0, mfa_steps_1.useMfaChoices)();
48
+ const enrolment = (0, mfa_steps_1.useMfaEnrollment)(attempt?.id ?? null, step.kind === 'enroll_second_factor');
49
+ const enrolSubmitKey = step.kind === 'enroll_second_factor' ? (0, js_1.enrollmentSubmitKey)(enrolment.state) : null;
42
50
  /**
43
51
  * The first factors this form may offer: the server's list, minus email code /
44
52
  * link while the app can't deliver email (a capability of the app, never a
@@ -59,6 +67,11 @@ function AttemptFlow({ attempt, onSubmit, busy, errors, titleKey, hideTitle, cap
59
67
  // Sending on its own (no password on offer): nothing to type until it lands.
60
68
  const sending = step.kind === 'collect_first_factor' && !noFirstFactor && sent === null && !plan.password && emailOptions.length > 0;
61
69
  const identifier = attempt?.identifier ?? '';
70
+ // A sign-up on an instance that verifies by link only: nothing to type — the
71
+ // tab polls until the emailed link is opened (anywhere).
72
+ const linkOnlySignUp = step.kind === 'collect_email_code' &&
73
+ attempt?.object === 'sign_up_attempt' &&
74
+ instanceSettings?.account?.emailVerification === 'link';
62
75
  /**
63
76
  * "Resend" waits out the server's `retry_after` when it answered 429, rather
64
77
  * than letting the user hit the same limit again.
@@ -103,18 +116,32 @@ function AttemptFlow({ attempt, onSubmit, busy, errors, titleKey, hideTitle, cap
103
116
  }
104
117
  return [field('password', 'signIn.passwordLabel', 'password', { autoComplete: 'current-password' })];
105
118
  case 'collect_second_factor':
106
- return [field('code', 'mfa.codeLabel')];
119
+ // "Text me a code instead" / "Email me a code instead", where the app offers them.
120
+ return [
121
+ field('code', 'mfa.codeLabel'),
122
+ ...(mfaChoices.sms && attempt?.id
123
+ ? [(0, jsx_runtime_1.jsx)(mfa_steps_1.SecondFactorCodeOption, { attemptId: attempt.id, strategy: "sms" }, "sms-2fa")]
124
+ : []),
125
+ ...(mfaChoices.emailCode && attempt?.id
126
+ ? [(0, jsx_runtime_1.jsx)(mfa_steps_1.SecondFactorCodeOption, { attemptId: attempt.id, strategy: "email_code" }, "email-2fa")]
127
+ : []),
128
+ ];
107
129
  case 'enroll_second_factor':
108
130
  /**
109
- * Two codes, not one. §5.6 wants consecutive codes so a phone with a
110
- * fast clock fails here rather than on every sign-in afterwards, and
111
- * asking for one would hide that failure until it was expensive.
131
+ * The authenticator app (QR code, setup key, then its code — two
132
+ * consecutive codes where the app asks for them, §5.6) or, where the
133
+ * app can text, a phone number and the texted code.
112
134
  */
113
135
  return [
114
- field('code', 'mfa.enrollFirstCodeLabel'),
115
- field('secondCode', 'mfa.enrollSecondCodeLabel'),
136
+ (0, jsx_runtime_1.jsx)(mfa_steps_1.MfaEnrollmentFields, { controller: enrolment.controller, state: enrolment.state, busy: busy, field: field, clearValues: () => setValues({}) }, "enrol"),
116
137
  ];
117
138
  case 'collect_email_code':
139
+ if (linkOnlySignUp) {
140
+ return [
141
+ (0, jsx_runtime_1.jsx)("p", { className: cls('text', 'atlas-text'), "data-atlas-link-sent": "", "aria-live": "polite", children: t('signUp.linkSentTo', { email: attempt?.identifier ?? '' }) }, "link-sent"),
142
+ attempt ? (0, jsx_runtime_1.jsx)(ResendSignUpLink, { attempt: attempt }, "resend") : null,
143
+ ];
144
+ }
118
145
  return [field('code', 'signIn.emailCodeLabel')];
119
146
  case 'collect_new_password':
120
147
  return [field('password', 'reset.newPasswordLabel', 'password')];
@@ -151,6 +178,9 @@ function AttemptFlow({ attempt, onSubmit, busy, errors, titleKey, hideTitle, cap
151
178
  ];
152
179
  }
153
180
  };
181
+ if (recoveryCodes && recoveryCodes.length && onRecoveryCodesSaved) {
182
+ return (0, jsx_runtime_1.jsx)(mfa_steps_1.RecoveryCodes, { codes: recoveryCodes, busy: busy, onSaved: onRecoveryCodesSaved });
183
+ }
154
184
  return ((0, jsx_runtime_1.jsxs)("div", { className: cardClass, children: [hideTitle ? null : (0, jsx_runtime_1.jsx)("h1", { className: titleClass, children: t(titleKey) }), errors
155
185
  .filter((error) => !error.param)
156
186
  .map((error) => ((0, jsx_runtime_1.jsx)("p", { className: errorClass, role: "alert", children: errorText(error) }, error.code))), (0, jsx_runtime_1.jsxs)("form", { onSubmit: (event) => {
@@ -162,8 +192,22 @@ function AttemptFlow({ attempt, onSubmit, busy, errors, titleKey, hideTitle, cap
162
192
  onSubmit(sent === 'email_code' ? { code: values.code ?? '' } : { password: values.password ?? '' });
163
193
  return;
164
194
  }
195
+ // Enrolment: text the code to the typed number, or confirm the factor.
196
+ if (step.kind === 'enroll_second_factor') {
197
+ void enrolment.controller.submit(values).then((next) => {
198
+ if (next)
199
+ onSubmit(next);
200
+ });
201
+ return;
202
+ }
165
203
  onSubmit(values);
166
- }, children: [fields(), step.kind === 'collect_identifier' || step.kind === 'collect_captcha' ? captcha : null, step.kind !== 'done' && step.kind !== 'await_oauth' && !noFirstFactor && sent !== 'email_link' && !sending ? ((0, jsx_runtime_1.jsx)("button", { className: buttonClass, disabled: busy, type: "submit", children: t('signIn.submit') })) : null, step.kind === 'collect_first_factor' && !noFirstFactor ? ((0, jsx_runtime_1.jsxs)("div", { className: "atlas-alternatives", children: [sent
204
+ }, children: [fields(), step.kind === 'collect_identifier' || step.kind === 'collect_captcha' ? captcha : null, step.kind !== 'done' &&
205
+ step.kind !== 'await_oauth' &&
206
+ !noFirstFactor &&
207
+ sent !== 'email_link' &&
208
+ !sending &&
209
+ !linkOnlySignUp &&
210
+ (step.kind !== 'enroll_second_factor' || enrolSubmitKey) ? ((0, jsx_runtime_1.jsx)("button", { className: buttonClass, disabled: busy || (step.kind === 'enroll_second_factor' && enrolment.state.busy), type: "submit", children: t(enrolSubmitKey ?? 'signIn.submit') })) : null, step.kind === 'collect_first_factor' && !noFirstFactor ? ((0, jsx_runtime_1.jsxs)("div", { className: "atlas-alternatives", children: [sent
167
211
  ? ((0, jsx_runtime_1.jsx)("button", { type: "button", className: cls('link', 'atlas-link'), "data-atlas-resend": "", disabled: busy || cooldown > 0, onClick: () => onPrepare?.(sent), children: cooldown > 0
168
212
  ? t('signIn.resendIn', { seconds: String(cooldown) })
169
213
  : t(sent === 'email_code' ? 'signIn.resendCode' : 'signIn.resendLink') }))
@@ -256,6 +300,11 @@ function useFlow({ afterUrl, signInCaptcha = true, referral, referralConsent, }
256
300
  // password/flow `submit` and the native (Google) button, so both complete a
257
301
  // sign-in identically.
258
302
  const finish = (0, react_1.useCallback)(async (next) => {
303
+ // An enrolment's recovery codes are shown first; `saveRecoveryCodes` finishes.
304
+ if ((0, js_1.pendingRecoveryCodes)(next)) {
305
+ setState({ ...next, busy: false });
306
+ return;
307
+ }
259
308
  if (next.attempt?.status !== 'complete') {
260
309
  setState(next);
261
310
  return;
@@ -387,7 +436,11 @@ function useFlow({ afterUrl, signInCaptcha = true, referral, referralConsent, }
387
436
  }, 2_000);
388
437
  return () => clearInterval(timer);
389
438
  }, [afterUrl, client, reload, state]);
390
- return { state, setState, submit, client, finish, captcha, prepare, usePassword };
439
+ /** "I've saved my codes": forget the recovery codes and finish the sign-in. */
440
+ const saveRecoveryCodes = (0, react_1.useCallback)(() => {
441
+ void finish((0, js_1.acknowledgeRecoveryCodes)(state));
442
+ }, [finish, state]);
443
+ return { state, setState, submit, client, finish, captcha, prepare, usePassword, saveRecoveryCodes };
391
444
  }
392
445
  /** Google's multi-color "G" mark — trusted, static, first-party SVG. */
393
446
  function GoogleMark() {
@@ -737,6 +790,71 @@ function AtlasSsoButton({ onClick, className, labelClassName, }) {
737
790
  * the returned ticket for a session. Previously `<SignIn>` rendered only the
738
791
  * Google button, so an instance's other social providers never appeared.
739
792
  */
793
+ /** "Resend link" on a link-only sign-up: a fresh email (the earlier link stops working). */
794
+ function ResendSignUpLink({ attempt }) {
795
+ const client = (0, components_shared_1.useFapiClient)();
796
+ const t = (0, components_shared_1.useText)();
797
+ const errorText = (0, components_shared_1.useErrorText)();
798
+ const cls = (0, components_shared_1.useClasses)();
799
+ const [state, setState] = (0, react_1.useState)({});
800
+ const send = () => {
801
+ setState({ busy: true });
802
+ void (0, js_1.resendSignUpVerification)(client, { attempt, errors: [], busy: true, pollSecret: null, ticket: null }).then((next) => setState(next.errors[0] ? { error: next.errors[0] } : { sent: true }));
803
+ };
804
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("button", { type: "button", className: cls('link', 'atlas-link'), "data-atlas-resend": "", disabled: state.busy, onClick: send, children: state.busy ? t('signIn.sending') : t('signIn.resendLink') }), state.error ? ((0, jsx_runtime_1.jsx)("div", { className: cls('alert', 'atlas-alert'), role: "alert", children: errorText(state.error) })) : null] }));
805
+ }
806
+ /**
807
+ * The method this browser last signed in with (`password`, `oauth_github`, …),
808
+ * for the "Last used" badge — null until known, when none is remembered, or
809
+ * when the instance turned the hint off.
810
+ */
811
+ function useLastSignInMethod(client) {
812
+ const { instanceSettings } = (0, AtlasProvider_1.useAtlas)();
813
+ const enabled = instanceSettings?.account?.lastSignInMethod === true;
814
+ const [method, setMethod] = (0, react_1.useState)(null);
815
+ (0, react_1.useEffect)(() => {
816
+ if (!enabled)
817
+ return;
818
+ let live = true;
819
+ void (0, js_1.fetchLastSignInMethod)(client).then((m) => {
820
+ if (live)
821
+ setMethod(m);
822
+ });
823
+ return () => {
824
+ live = false;
825
+ };
826
+ }, [client, enabled]);
827
+ return enabled ? method : null;
828
+ }
829
+ /** The small "Last used" badge on a sign-in option. */
830
+ function LastUsedBadge() {
831
+ const t = (0, components_shared_1.useText)();
832
+ const cls = (0, components_shared_1.useClasses)();
833
+ return ((0, jsx_runtime_1.jsx)("span", { className: cls('badge', 'atlas-badge atlas-last-used'), "data-atlas": "last-used", style: LAST_USED_BADGE_STYLE, children: t('signIn.lastUsed') }));
834
+ }
835
+ const LAST_USED_BADGE_STYLE = {
836
+ marginInlineStart: 'auto',
837
+ fontSize: '0.75em',
838
+ padding: '1px 6px',
839
+ borderRadius: 999,
840
+ border: '1px solid currentColor',
841
+ opacity: 0.7,
842
+ whiteSpace: 'nowrap',
843
+ };
844
+ /**
845
+ * Above the identifier step: which first-party method (password, email code,
846
+ * passkey, phone) this browser used last. Social methods are badged on their
847
+ * own buttons instead.
848
+ */
849
+ function LastUsedHint({ client }) {
850
+ const last = useLastSignInMethod(client);
851
+ const t = (0, components_shared_1.useText)();
852
+ const cls = (0, components_shared_1.useClasses)();
853
+ const label = (0, js_1.lastUsedMethodLabel)(last, t);
854
+ if (!label)
855
+ return null;
856
+ return ((0, jsx_runtime_1.jsxs)("p", { className: cls('text', 'atlas-text atlas-last-used-hint'), "data-atlas": "last-used", "data-atlas-method": last, children: [t('signIn.lastUsed'), ": ", label] }));
857
+ }
740
858
  function SocialSignInButtons({ client, onComplete, oneTap, oauthMode, onProviderUnavailable, googleButton, }) {
741
859
  const socialButtonClass = (0, components_shared_1.useClass)('socialButton', 'atlas-social-button');
742
860
  const cls = (0, components_shared_1.useClasses)();
@@ -744,6 +862,7 @@ function SocialSignInButtons({ client, onComplete, oneTap, oauthMode, onProvider
744
862
  const errorText = (0, components_shared_1.useErrorText)();
745
863
  const effectiveMode = oauthMode ?? providerOauthMode ?? 'redirect';
746
864
  const { environment, loadEnvironment, appearanceData } = (0, AtlasProvider_1.useAtlas)();
865
+ const lastMethod = useLastSignInMethod(client);
747
866
  // From the provider's own `/v1/appearance` (server-seeded or fetched once); no
748
867
  // Atlas button until it is known.
749
868
  const atlasConnection = (0, react_1.useMemo)(() => appearanceData && typeof appearanceData === 'object'
@@ -835,10 +954,10 @@ function SocialSignInButtons({ client, onComplete, oneTap, oauthMode, onProvider
835
954
  window.location.href = res.authorizationUrl;
836
955
  })();
837
956
  }, [client, effectiveMode, onComplete]);
838
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(GoogleSignInButton, { client: client, onComplete: onComplete, oneTap: oneTap, googleButton: googleButton, onRedirect: () => startSocial('google'), onUnavailable: onProviderUnavailable ? (reason) => onProviderUnavailable('google', reason) : undefined }), redirectProviders.map(({ provider, label, icon }) => ((0, jsx_runtime_1.jsxs)("div", { className: socialButtonClass, "data-atlas": "social-signin", "data-atlas-provider": provider, role: "button", tabIndex: 0, style: DEFAULT_SOCIAL_BUTTON_STYLE, onClick: () => startSocial(provider), onKeyDown: (e) => {
957
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(GoogleSignInButton, { client: client, onComplete: onComplete, oneTap: oneTap, googleButton: googleButton, onRedirect: () => startSocial('google'), onUnavailable: onProviderUnavailable ? (reason) => onProviderUnavailable('google', reason) : undefined }), (0, js_1.isLastUsed)(lastMethod, 'google') && !redirectProviders.some((p) => p.provider === 'google') ? ((0, jsx_runtime_1.jsx)("div", { "data-atlas-provider": "google", style: { display: 'flex' }, children: (0, jsx_runtime_1.jsx)(LastUsedBadge, {}) })) : null, redirectProviders.map(({ provider, label, icon }) => ((0, jsx_runtime_1.jsxs)("div", { className: socialButtonClass, "data-atlas": "social-signin", "data-atlas-provider": provider, role: "button", tabIndex: 0, style: DEFAULT_SOCIAL_BUTTON_STYLE, onClick: () => startSocial(provider), onKeyDown: (e) => {
839
958
  if (e.key === 'Enter' || e.key === ' ')
840
959
  startSocial(provider);
841
- }, children: [icon?.type === 'svg' ? ((0, jsx_runtime_1.jsx)("span", { className: cls('socialButtonIcon', 'atlas-social-icon'), "aria-hidden": true, dangerouslySetInnerHTML: { __html: icon.value } })) : icon?.type === 'url' ? ((0, jsx_runtime_1.jsx)("span", { className: cls('socialButtonIcon', 'atlas-social-icon'), children: (0, jsx_runtime_1.jsx)("img", { src: icon.value, width: 18, height: 18, alt: "", loading: "lazy" }) })) : null, (0, jsx_runtime_1.jsx)("span", { className: cls('socialButtonText', 'atlas-social-label'), children: label ?? `Continue with ${providerLabel(provider)}` })] }, provider))), atlasConnection ? ((0, jsx_runtime_1.jsx)(AtlasSsoButton, { className: socialButtonClass, labelClassName: cls('socialButtonText', 'atlas-social-label'), onClick: startAtlas })) : null, atlasError ? ((0, jsx_runtime_1.jsx)("div", { className: cls('alert', 'atlas-alert'), role: "alert", "data-atlas": "social-signin-error", children: atlasError })) : null] }));
960
+ }, children: [icon?.type === 'svg' ? ((0, jsx_runtime_1.jsx)("span", { className: cls('socialButtonIcon', 'atlas-social-icon'), "aria-hidden": true, dangerouslySetInnerHTML: { __html: icon.value } })) : icon?.type === 'url' ? ((0, jsx_runtime_1.jsx)("span", { className: cls('socialButtonIcon', 'atlas-social-icon'), children: (0, jsx_runtime_1.jsx)("img", { src: icon.value, width: 18, height: 18, alt: "", loading: "lazy" }) })) : null, (0, jsx_runtime_1.jsx)("span", { className: cls('socialButtonText', 'atlas-social-label'), children: label ?? `Continue with ${providerLabel(provider)}` }), (0, js_1.isLastUsed)(lastMethod, provider) ? (0, jsx_runtime_1.jsx)(LastUsedBadge, {}) : null] }, provider))), atlasConnection ? ((0, jsx_runtime_1.jsx)(AtlasSsoButton, { className: socialButtonClass, labelClassName: cls('socialButtonText', 'atlas-social-label'), onClick: startAtlas })) : null, atlasError ? ((0, jsx_runtime_1.jsx)("div", { className: cls('alert', 'atlas-alert'), role: "alert", "data-atlas": "social-signin-error", children: atlasError })) : null] }));
842
961
  }
843
962
  /**
844
963
  * "No account? Sign up" under `<SignIn>`. Shown on every step before the