@abpjs/ui 0.2.0-next.5 → 0.2.0-next.7
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/CHANGELOG.md +15 -0
- package/dist/index.d.ts +19 -3
- package/dist/index.js +53 -11
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.0-next.7
|
|
4
|
+
|
|
5
|
+
A prerelease under npm's `next` tag.
|
|
6
|
+
|
|
7
|
+
- Exports the passkey helpers next.5 described and didn't export: `createPasskey`, `getPasskey`, `passkeysSupported`.
|
|
8
|
+
|
|
9
|
+
## 0.2.0-next.6
|
|
10
|
+
|
|
11
|
+
A prerelease under npm's `next` tag.
|
|
12
|
+
|
|
13
|
+
- `StepUpDialog`: an authenticator code alone where the server lets one pass (`appCodeAlone` in `step_up_required`'s
|
|
14
|
+
data, the operator's setting): the strong level asks for the code alone (a passkey still first when the person has
|
|
15
|
+
one), and the password level offers it instead of the password. Without the field, a code goes with the password, as
|
|
16
|
+
before. `StepUpNeed.appCodeAlone`.
|
|
17
|
+
|
|
3
18
|
## 0.2.0-next.5
|
|
4
19
|
|
|
5
20
|
A prerelease under npm's `next` tag: the step-up dialog for AbpGuard 0.7.0's strong step-up and passkeys. Against an
|
package/dist/index.d.ts
CHANGED
|
@@ -235,6 +235,8 @@ interface StepUpNeed {
|
|
|
235
235
|
category: string | null;
|
|
236
236
|
/** The person's ways at that level, best first: `passkey`, `app`, `password`, `email`… Empty when the server doesn't say. */
|
|
237
237
|
methods: string[];
|
|
238
|
+
/** An authenticator code alone passes (the operator's setting, AbpGuard's `appCodeAlone`); else it goes with the password. */
|
|
239
|
+
appCodeAlone: boolean;
|
|
238
240
|
}
|
|
239
241
|
/** What asks the person to confirm who they are: true once confirmed (or a strong factor set up), false if they gave up. */
|
|
240
242
|
type StepUpHandler = (need: StepUpNeed) => Promise<boolean>;
|
|
@@ -1559,8 +1561,9 @@ declare function looksLikeCode(value: string, recovery: boolean): boolean;
|
|
|
1559
1561
|
*
|
|
1560
1562
|
* - At the password level: the password, and a code of their second factor when they have one (their app, a recovery
|
|
1561
1563
|
* code, or one the site sends).
|
|
1562
|
-
* - At the strong level (AbpGuard 0.7.0): a passkey first when they have one, or
|
|
1563
|
-
* code
|
|
1564
|
+
* - At the strong level (AbpGuard 0.7.0): a passkey first when they have one, or an authenticator code: alone where the
|
|
1565
|
+
* server says one passes alone (`appCodeAlone`, the operator's setting), else with the password. Where a code passes
|
|
1566
|
+
* alone it's offered at the password level too.
|
|
1564
1567
|
* - Asked for a strong step-up with no strong factor (`strong_factor_required`): the password, then setting up a passkey
|
|
1565
1568
|
* or the app here (with recovery codes, shown once, for a first factor); the call then asks again, and they confirm
|
|
1566
1569
|
* with what they set up.
|
|
@@ -1570,6 +1573,19 @@ declare function looksLikeCode(value: string, recovery: boolean): boolean;
|
|
|
1570
1573
|
*/
|
|
1571
1574
|
declare function StepUpDialog(): react.JSX.Element;
|
|
1572
1575
|
|
|
1576
|
+
/**
|
|
1577
|
+
* Passkeys in the browser (WebAuthn), in the browser's own JSON both ways, as AbpGuard 0.7.0 speaks it: the options come
|
|
1578
|
+
* as `PublicKeyCredentialCreationOptionsJSON` / `PublicKeyCredentialRequestOptionsJSON`, and the answer goes back as the
|
|
1579
|
+
* credential's `toJSON()`. Browsers without the JSON methods get the same through base64url here.
|
|
1580
|
+
*/
|
|
1581
|
+
type Json = Record<string, unknown>;
|
|
1582
|
+
/** Whether this browser can use passkeys at all (a secure page with WebAuthn). */
|
|
1583
|
+
declare function passkeysSupported(): boolean;
|
|
1584
|
+
/** Makes a passkey on this device from the server's creation options; null when the person cancelled. */
|
|
1585
|
+
declare function createPasskey(options: Json, signal?: AbortSignal): Promise<Json | null>;
|
|
1586
|
+
/** Proves a passkey from the server's request options; null when the person cancelled or had none here. */
|
|
1587
|
+
declare function getPasskey(options: Json, signal?: AbortSignal): Promise<Json | null>;
|
|
1588
|
+
|
|
1573
1589
|
/**
|
|
1574
1590
|
* A text with its values filled, in the subset of ICU message syntax the screens' texts use: `{name}`, plurals
|
|
1575
1591
|
* (`{count, plural, =0 {none} one {# item} other {# items}}`, with Arabic's zero, two, few and many) and choices
|
|
@@ -2792,4 +2808,4 @@ interface TooltipProps extends Omit<Tooltip$1.RootProps, 'children'> {
|
|
|
2792
2808
|
*/
|
|
2793
2809
|
declare const Tooltip: react.ForwardRefExoticComponent<TooltipProps & react.RefAttributes<HTMLDivElement>>;
|
|
2794
2810
|
|
|
2795
|
-
export { ABP_UI_VERSION, AbpApiError, type AbpBrand, type AbpHost, type AbpLabels, AbpProvider, type AbpProviderProps, type AbpSystemOptions, type ApiQuery, AppLink, type AppLinkProps, AppShell, type AppShellBrand, type AppShellNavItem, type AppShellNavSection, type AppShellPlace, type AppShellProps, type AppShellSidebar, type AreaTexts, type Arrival, ArriveOnChange, type ArriveOnChangeProps, AttentionChip, type AttentionChipProps, type AvatarPerson, AvatarStack, type AvatarStackProps, Bone, type BoneProps, type BreadcrumbItem, Breadcrumbs, Button, type ButtonProps, type ButtonSize, type ButtonVariant, CalendarGrid, type CalendarGridProps, type CalendarItem, type CardDates, CategoryProgress, type CategoryProgressProps, type CelebrateTarget, Chart, type ChartProps, type ChartSeries, CheckboxField, type CheckboxFieldProps, Collapse, type CollapseProps, type ColorMode, ColorModeProvider, ColorModeToggle, type CommandGroup, type CommandItem, CommandPalette, type CommandPaletteProps, ConfirmDialog, type ConfirmDialogProps, type ConfirmOptions, ConfirmProvider, CountBadge, type CountBadgeProps, Counter, type CounterProps, DashboardGrid, type DashboardGridProps, DataTable, type DataTableColumn, type DataTableProps, type DataTableSelection, type DataTableSort, type Direction, DirectionalIcon, DropHint, type DropHintProps, type DropZoneOptions, type DropZoneState, type DroppedFile, EMPTY_VALUE, EmptyState, type EmptyStateProps, FadeIn, type FadeInProps, Field, type FieldProps, FileDropArea, type FileDropAreaProps, FormDialog, type FormDialogProps, FormField, type GridItem, HighlightText, type HostEventHandler, type HostEvents, type HostFile, type HostLanguage, HostProvider, type HostRequest, type HostRequestInit, type HostRequestOptions, type HostScope, HostSlot, IconButton, type IconButtonProps, IconTile, type IconTileProps, Indicator, type IndicatorProps, InlineAlert, type InlineAlertProps, KanbanBoard, type KanbanBoardProps, type KanbanColumn, type KanbanItem, type KanbanLane, type KanbanMove, type LinkComponent, Loading, type LoadingProps, LoadingState, MotionProvider, type MotionSetting, type MotionState, Nudge, type NudgeProps, PageHeader, type PageHeaderProps, PageTitleProvider, Pagination, type PaginationProps, Panel, type PanelProps, PanelTone, type Particle, PathChips, type PathChipsProps, PersonChip, type PersonChipProps, type PlacedCard, PluginTextsProvider, type Pose, Presence, PresenceItem, type PresenceItemProps, PresenceList, type PresenceListProps, type PresenceProps, Pressable, type PressableProps, PriorityMark, type PriorityMarkProps, type PropertyItem, PropertyList, type PropertyListProps, type QueryConditionJson, type QueryExportFormat, type QueryField, type QueryGroup, type QueryJson, type QueryListLabels, type QueryNodeJson, type QueryRow, type QuerySuggestion, type QuerySuggestions, type QueryValueEditor, QueryableList, type QueryableListError, type QueryableListExport, type QueryableListProps, type QueryableListState, type QueryableListView, type QueueProgress, RecordKey, type RecordKeyProps, type RegisterSlotSave, Reveal, RevealItem, type RevealItemProps, type RevealProps, SHOWN, STEP_UP_REQUIRED, STRONG_FACTOR_REQUIRED, type Scale, SearchInput, type SearchInputProps, type SectionMove, SegmentedControl, type SegmentedControlProps, type SegmentedItem, SelectField, type SelectFieldProps, type SelectOption, type SettingsArea, SettingsLayout, type SettingsLayoutProps, type SettingsPage, type SettingsSection, SlideItem, type SlideItemProps, SlideList, type SlideListProps, type SlotSave, type SortDirection, type SortableSection, SortableSections, type SortableSectionsProps, type StatusCategory, StatusPill, type StatusPillProps, type StatusTone, StepUpDialog, type StepUpHandler, type StepUpNeed, Swap, type SwapProps, SwitchField, type SwitchFieldProps, TITLE_SEPARATOR, TextBone, type TextBoneProps, TextSlot, type TextSlotProps, type TimelineCardItem, TimelineCards, type TimelineCardsProps, TimelineChart, type TimelineChartProps, type TimelineItem, type TimelineRow, type TimelineScale, type TitleParts, Toaster, Tooltip, type TooltipProps, UPLOADS_AT_ONCE, type UploadJob, UploadList, type UploadListProps, type UploadRow, type UploadState, abpConfig, arriveCss, asMotionSetting, avatarPalette, basicConditions, boneWidth, burst, compactLayout, compareOrdinal, composeTitle, covers, createAbpSystem, createAreaTexts, createHostEvents, createHostRequest, curves, defaultBrand, defaultLabels, defaultQueryListLabels, directionOf, droppedFiles, errorText, fileNameOf, findSettingsPage, folderOf, foldersFor, formatDateTime, formatMessage, formatNumber, ghostCss, groupKey, heavierFirst, hiddenPose, inSections, isStepUp, looksLikeCode, durations as motionDurations, needsStepUp, notify, pageList, partsOf, pastedName, placeCards, placeItem, priorityLevel, progressOf, readAbpError, readEvents, refusal, requestStepUp, setStepUpHandler, settingsArea, shineCss, springs, staggerDelay, stepUpNeedOf, targetOf, toStart, toaster, useAbpLabels, useAbpLocale, useAbpTimeZone, useApiAction, useApiDownload, useApiQuery, useAreaEvents, useAreaRequest, useArriving, useCan, useCelebrate, useColorMode, useConfirm, useDropZone, useFilesOverPage, useFormatters, useHost, useHostLanguages, useLinkComponent, useLoading, useMe, useMotionSetting, useNames, useNavigate, useOptionalHost, usePageDrop, usePageTitle, usePageTitleParts, usePageTitleSite, usePastedFiles, usePluginTexts, useProductName, useSlotSaves, useTokenVar };
|
|
2811
|
+
export { ABP_UI_VERSION, AbpApiError, type AbpBrand, type AbpHost, type AbpLabels, AbpProvider, type AbpProviderProps, type AbpSystemOptions, type ApiQuery, AppLink, type AppLinkProps, AppShell, type AppShellBrand, type AppShellNavItem, type AppShellNavSection, type AppShellPlace, type AppShellProps, type AppShellSidebar, type AreaTexts, type Arrival, ArriveOnChange, type ArriveOnChangeProps, AttentionChip, type AttentionChipProps, type AvatarPerson, AvatarStack, type AvatarStackProps, Bone, type BoneProps, type BreadcrumbItem, Breadcrumbs, Button, type ButtonProps, type ButtonSize, type ButtonVariant, CalendarGrid, type CalendarGridProps, type CalendarItem, type CardDates, CategoryProgress, type CategoryProgressProps, type CelebrateTarget, Chart, type ChartProps, type ChartSeries, CheckboxField, type CheckboxFieldProps, Collapse, type CollapseProps, type ColorMode, ColorModeProvider, ColorModeToggle, type CommandGroup, type CommandItem, CommandPalette, type CommandPaletteProps, ConfirmDialog, type ConfirmDialogProps, type ConfirmOptions, ConfirmProvider, CountBadge, type CountBadgeProps, Counter, type CounterProps, DashboardGrid, type DashboardGridProps, DataTable, type DataTableColumn, type DataTableProps, type DataTableSelection, type DataTableSort, type Direction, DirectionalIcon, DropHint, type DropHintProps, type DropZoneOptions, type DropZoneState, type DroppedFile, EMPTY_VALUE, EmptyState, type EmptyStateProps, FadeIn, type FadeInProps, Field, type FieldProps, FileDropArea, type FileDropAreaProps, FormDialog, type FormDialogProps, FormField, type GridItem, HighlightText, type HostEventHandler, type HostEvents, type HostFile, type HostLanguage, HostProvider, type HostRequest, type HostRequestInit, type HostRequestOptions, type HostScope, HostSlot, IconButton, type IconButtonProps, IconTile, type IconTileProps, Indicator, type IndicatorProps, InlineAlert, type InlineAlertProps, KanbanBoard, type KanbanBoardProps, type KanbanColumn, type KanbanItem, type KanbanLane, type KanbanMove, type LinkComponent, Loading, type LoadingProps, LoadingState, MotionProvider, type MotionSetting, type MotionState, Nudge, type NudgeProps, PageHeader, type PageHeaderProps, PageTitleProvider, Pagination, type PaginationProps, Panel, type PanelProps, PanelTone, type Particle, PathChips, type PathChipsProps, PersonChip, type PersonChipProps, type PlacedCard, PluginTextsProvider, type Pose, Presence, PresenceItem, type PresenceItemProps, PresenceList, type PresenceListProps, type PresenceProps, Pressable, type PressableProps, PriorityMark, type PriorityMarkProps, type PropertyItem, PropertyList, type PropertyListProps, type QueryConditionJson, type QueryExportFormat, type QueryField, type QueryGroup, type QueryJson, type QueryListLabels, type QueryNodeJson, type QueryRow, type QuerySuggestion, type QuerySuggestions, type QueryValueEditor, QueryableList, type QueryableListError, type QueryableListExport, type QueryableListProps, type QueryableListState, type QueryableListView, type QueueProgress, RecordKey, type RecordKeyProps, type RegisterSlotSave, Reveal, RevealItem, type RevealItemProps, type RevealProps, SHOWN, STEP_UP_REQUIRED, STRONG_FACTOR_REQUIRED, type Scale, SearchInput, type SearchInputProps, type SectionMove, SegmentedControl, type SegmentedControlProps, type SegmentedItem, SelectField, type SelectFieldProps, type SelectOption, type SettingsArea, SettingsLayout, type SettingsLayoutProps, type SettingsPage, type SettingsSection, SlideItem, type SlideItemProps, SlideList, type SlideListProps, type SlotSave, type SortDirection, type SortableSection, SortableSections, type SortableSectionsProps, type StatusCategory, StatusPill, type StatusPillProps, type StatusTone, StepUpDialog, type StepUpHandler, type StepUpNeed, Swap, type SwapProps, SwitchField, type SwitchFieldProps, TITLE_SEPARATOR, TextBone, type TextBoneProps, TextSlot, type TextSlotProps, type TimelineCardItem, TimelineCards, type TimelineCardsProps, TimelineChart, type TimelineChartProps, type TimelineItem, type TimelineRow, type TimelineScale, type TitleParts, Toaster, Tooltip, type TooltipProps, UPLOADS_AT_ONCE, type UploadJob, UploadList, type UploadListProps, type UploadRow, type UploadState, abpConfig, arriveCss, asMotionSetting, avatarPalette, basicConditions, boneWidth, burst, compactLayout, compareOrdinal, composeTitle, covers, createAbpSystem, createAreaTexts, createHostEvents, createHostRequest, createPasskey, curves, defaultBrand, defaultLabels, defaultQueryListLabels, directionOf, droppedFiles, errorText, fileNameOf, findSettingsPage, folderOf, foldersFor, formatDateTime, formatMessage, formatNumber, getPasskey, ghostCss, groupKey, heavierFirst, hiddenPose, inSections, isStepUp, looksLikeCode, durations as motionDurations, needsStepUp, notify, pageList, partsOf, passkeysSupported, pastedName, placeCards, placeItem, priorityLevel, progressOf, readAbpError, readEvents, refusal, requestStepUp, setStepUpHandler, settingsArea, shineCss, springs, staggerDelay, stepUpNeedOf, targetOf, toStart, toaster, useAbpLabels, useAbpLocale, useAbpTimeZone, useApiAction, useApiDownload, useApiQuery, useAreaEvents, useAreaRequest, useArriving, useCan, useCelebrate, useColorMode, useConfirm, useDropZone, useFilesOverPage, useFormatters, useHost, useHostLanguages, useLinkComponent, useLoading, useMe, useMotionSetting, useNames, useNavigate, useOptionalHost, usePageDrop, usePageTitle, usePageTitleParts, usePageTitleSite, usePastedFiles, usePluginTexts, useProductName, useSlotSaves, useTokenVar };
|
package/dist/index.js
CHANGED
|
@@ -1560,7 +1560,7 @@ function useTokenVar() {
|
|
|
1560
1560
|
}
|
|
1561
1561
|
|
|
1562
1562
|
// src/version.ts
|
|
1563
|
-
var ABP_UI_VERSION = true ? "0.2.0-next.
|
|
1563
|
+
var ABP_UI_VERSION = true ? "0.2.0-next.7" : "0.0.0-dev";
|
|
1564
1564
|
|
|
1565
1565
|
// src/provider/time-zone.tsx
|
|
1566
1566
|
import { createContext, useContext } from "react";
|
|
@@ -2596,9 +2596,9 @@ function setStepUpHandler(next) {
|
|
|
2596
2596
|
function stepUpNeedOf(code, data) {
|
|
2597
2597
|
const level = code === "strong_factor_required" || data?.level === "strong" ? "strong" : "password";
|
|
2598
2598
|
const methods = Array.isArray(data?.methods) ? data.methods.filter((m4) => typeof m4 === "string") : [];
|
|
2599
|
-
return { code, level, category: typeof data?.category === "string" ? data.category : null, methods };
|
|
2599
|
+
return { code, level, category: typeof data?.category === "string" ? data.category : null, methods, appCodeAlone: data?.appCodeAlone === true };
|
|
2600
2600
|
}
|
|
2601
|
-
function requestStepUp(need = { code: "step_up_required", level: "password", category: null, methods: [] }) {
|
|
2601
|
+
function requestStepUp(need = { code: "step_up_required", level: "password", category: null, methods: [], appCodeAlone: false }) {
|
|
2602
2602
|
if (!handler) return Promise.resolve(false);
|
|
2603
2603
|
pending ??= handler(need).finally(() => {
|
|
2604
2604
|
pending = null;
|
|
@@ -2659,7 +2659,10 @@ var ar_default = {
|
|
|
2659
2659
|
recoverySaved: "\u062D\u0641\u0638\u062A\u0647\u0627",
|
|
2660
2660
|
continue: "\u0645\u062A\u0627\u0628\u0639\u0629",
|
|
2661
2661
|
back: "\u0631\u062C\u0648\u0639",
|
|
2662
|
-
strongWhyApp: "\u064A\u062A\u0637\u0644\u0628 \u0647\u0630\u0627 \u0627\u0644\u0625\u062C\u0631\u0627\u0621 \u0623\u0643\u062B\u0631 \u0645\u0646 \u0643\u0644\u0645\u0629 \u0627\u0644\u0645\u0631\u0648\u0631: \u0623\u062F\u062E\u0644\u0647\u0627 \u0645\u0639 \u0631\u0645\u0632 \u0645\u0646 \u062A\u0637\u0628\u064A\u0642 \u0627\u0644\u0645\u0635\u0627\u062F\u0642\u0629."
|
|
2662
|
+
strongWhyApp: "\u064A\u062A\u0637\u0644\u0628 \u0647\u0630\u0627 \u0627\u0644\u0625\u062C\u0631\u0627\u0621 \u0623\u0643\u062B\u0631 \u0645\u0646 \u0643\u0644\u0645\u0629 \u0627\u0644\u0645\u0631\u0648\u0631: \u0623\u062F\u062E\u0644\u0647\u0627 \u0645\u0639 \u0631\u0645\u0632 \u0645\u0646 \u062A\u0637\u0628\u064A\u0642 \u0627\u0644\u0645\u0635\u0627\u062F\u0642\u0629.",
|
|
2663
|
+
appCodeWhy: "\u0623\u062F\u062E\u0644 \u0631\u0645\u0632\u064B\u0627 \u0645\u0646 \u062A\u0637\u0628\u064A\u0642 \u0627\u0644\u0645\u0635\u0627\u062F\u0642\u0629.",
|
|
2664
|
+
useAppCode: "\u0627\u0633\u062A\u062E\u062F\u0645 \u0631\u0645\u0632\u064B\u0627 \u0645\u0646 \u062A\u0637\u0628\u064A\u0642 \u0627\u0644\u0645\u0635\u0627\u062F\u0642\u0629 \u0628\u062F\u0644\u064B\u0627 \u0645\u0646 \u0630\u0644\u0643",
|
|
2665
|
+
usePassword: "\u0627\u0633\u062A\u062E\u062F\u0645 \u0643\u0644\u0645\u0629 \u0627\u0644\u0645\u0631\u0648\u0631 \u0628\u062F\u0644\u064B\u0627 \u0645\u0646 \u0630\u0644\u0643"
|
|
2663
2666
|
};
|
|
2664
2667
|
|
|
2665
2668
|
// src/host/step-up-texts/en.json
|
|
@@ -2715,7 +2718,10 @@ var en_default = {
|
|
|
2715
2718
|
recoverySaved: "I've saved them",
|
|
2716
2719
|
continue: "Continue",
|
|
2717
2720
|
back: "Back",
|
|
2718
|
-
strongWhyApp: "This action needs more than your password: enter it with a code from your authenticator app."
|
|
2721
|
+
strongWhyApp: "This action needs more than your password: enter it with a code from your authenticator app.",
|
|
2722
|
+
appCodeWhy: "Enter a code from your authenticator app.",
|
|
2723
|
+
useAppCode: "Use a code from your authenticator app instead",
|
|
2724
|
+
usePassword: "Use your password instead"
|
|
2719
2725
|
};
|
|
2720
2726
|
|
|
2721
2727
|
// src/host/webauthn.ts
|
|
@@ -2843,7 +2849,8 @@ function StepUpDialog() {
|
|
|
2843
2849
|
setRecoveryCodes([]);
|
|
2844
2850
|
setCopied(false);
|
|
2845
2851
|
const passkeyFirst = asked.code !== "strong_factor_required" && asked.level === "strong" && asked.methods.includes("passkey") && passkeysSupported();
|
|
2846
|
-
|
|
2852
|
+
const codeFirst = asked.code !== "strong_factor_required" && asked.level === "strong" && asked.appCodeAlone && asked.methods.includes("app");
|
|
2853
|
+
setStage(passkeyFirst ? "passkey" : codeFirst ? "code" : "confirm");
|
|
2847
2854
|
setMethod("app");
|
|
2848
2855
|
setOpen(true);
|
|
2849
2856
|
})
|
|
@@ -2916,6 +2923,27 @@ function StepUpDialog() {
|
|
|
2916
2923
|
setBusy(false);
|
|
2917
2924
|
}
|
|
2918
2925
|
}
|
|
2926
|
+
async function confirmCode(e) {
|
|
2927
|
+
e.preventDefault();
|
|
2928
|
+
setBusy(true);
|
|
2929
|
+
setError(null);
|
|
2930
|
+
try {
|
|
2931
|
+
await call("/session/step-up", { method: "POST", body: { method: "app", code: code.replace(/\D/g, "") } });
|
|
2932
|
+
close(true);
|
|
2933
|
+
} catch (e2) {
|
|
2934
|
+
if (ended(e2)) return;
|
|
2935
|
+
setError(e2 instanceof AbpApiError && e2.message ? e2.message : t("failed"));
|
|
2936
|
+
setCode("");
|
|
2937
|
+
} finally {
|
|
2938
|
+
setBusy(false);
|
|
2939
|
+
}
|
|
2940
|
+
}
|
|
2941
|
+
const codeAlone = !!need?.appCodeAlone && !!need.methods.includes("app") && !settingUp;
|
|
2942
|
+
const toStage = (next) => {
|
|
2943
|
+
setStage(next);
|
|
2944
|
+
setCode("");
|
|
2945
|
+
setError(null);
|
|
2946
|
+
};
|
|
2919
2947
|
async function withPasskey() {
|
|
2920
2948
|
setBusy(true);
|
|
2921
2949
|
setError(null);
|
|
@@ -3033,13 +3061,23 @@ function StepUpDialog() {
|
|
|
3033
3061
|
/* @__PURE__ */ jsx15(Button, { variant: "primary", onClick: () => void withPasskey(), loading: busy, "data-testid": "use-passkey", children: t("usePasskey") }),
|
|
3034
3062
|
busy && /* @__PURE__ */ jsx15(Text, { textStyle: "sm", color: "fg.muted", children: t("passkeyPrompt") }),
|
|
3035
3063
|
/* @__PURE__ */ jsx15(InlineAlert, { tone: "danger", children: error }),
|
|
3036
|
-
need?.methods.includes("app") && /* @__PURE__ */ jsx15(Button, { variant: "link", size: "sm", onClick: () =>
|
|
3037
|
-
setStage("confirm");
|
|
3038
|
-
setError(null);
|
|
3039
|
-
}, "data-testid": "use-password-and-app", children: t("usePasswordAndApp") })
|
|
3064
|
+
need?.methods.includes("app") && /* @__PURE__ */ jsx15(Button, { variant: "link", size: "sm", onClick: () => toStage(codeAlone ? "code" : "confirm"), "data-testid": "use-password-and-app", children: codeAlone ? t("useAppCode") : t("usePasswordAndApp") })
|
|
3040
3065
|
] }) }),
|
|
3041
3066
|
footer(null)
|
|
3042
3067
|
] });
|
|
3068
|
+
} else if (stage === "code") {
|
|
3069
|
+
body = /* @__PURE__ */ jsxs7("form", { onSubmit: (e) => void confirmCode(e), children: [
|
|
3070
|
+
/* @__PURE__ */ jsx15(Dialog2.Body, { children: /* @__PURE__ */ jsxs7(Stack2, { gap: "field", children: [
|
|
3071
|
+
/* @__PURE__ */ jsx15(Text, { color: "fg.muted", children: t("appCodeWhy") }),
|
|
3072
|
+
codeInput(t("code")),
|
|
3073
|
+
/* @__PURE__ */ jsx15(InlineAlert, { tone: "danger", children: error }),
|
|
3074
|
+
/* @__PURE__ */ jsxs7(Stack2, { gap: "0.5", align: "start", children: [
|
|
3075
|
+
need?.methods.includes("passkey") && canPasskey && /* @__PURE__ */ jsx15(Button, { variant: "link", size: "sm", onClick: () => toStage("passkey"), children: t("usePasskey") }),
|
|
3076
|
+
!strong && /* @__PURE__ */ jsx15(Button, { variant: "link", size: "sm", onClick: () => toStage("confirm"), "data-testid": "use-password", children: t("usePassword") })
|
|
3077
|
+
] })
|
|
3078
|
+
] }) }),
|
|
3079
|
+
footer(t("confirm"), !looksLikeCode(code, false))
|
|
3080
|
+
] });
|
|
3043
3081
|
} else if (stage === "confirm" && strong && !settingUp) {
|
|
3044
3082
|
body = /* @__PURE__ */ jsxs7("form", { onSubmit: (e) => void confirm(e), children: [
|
|
3045
3083
|
/* @__PURE__ */ jsx15(Dialog2.Body, { children: /* @__PURE__ */ jsxs7(Stack2, { gap: "field", children: [
|
|
@@ -3074,7 +3112,8 @@ function StepUpDialog() {
|
|
|
3074
3112
|
ways.hasApp && !recovery && /* @__PURE__ */ jsx15(Button, { variant: "link", size: "sm", onClick: () => switchTo("recovery"), children: t("useRecovery") })
|
|
3075
3113
|
] })
|
|
3076
3114
|
] }),
|
|
3077
|
-
/* @__PURE__ */ jsx15(InlineAlert, { tone: "danger", children: error })
|
|
3115
|
+
/* @__PURE__ */ jsx15(InlineAlert, { tone: "danger", children: error }),
|
|
3116
|
+
codeAlone && !ways && /* @__PURE__ */ jsx15(Button, { variant: "link", size: "sm", alignSelf: "start", onClick: () => toStage("code"), "data-testid": "use-app-code", children: t("useAppCode") })
|
|
3078
3117
|
] }) }),
|
|
3079
3118
|
footer(settingUp ? t("continue") : t("confirm"), !password || !!ways && !looksLikeCode(code, recovery))
|
|
3080
3119
|
] });
|
|
@@ -9475,6 +9514,7 @@ export {
|
|
|
9475
9514
|
createAreaTexts,
|
|
9476
9515
|
createHostEvents,
|
|
9477
9516
|
createHostRequest,
|
|
9517
|
+
createPasskey,
|
|
9478
9518
|
curves,
|
|
9479
9519
|
defaultBrand,
|
|
9480
9520
|
defaultLabels,
|
|
@@ -9489,6 +9529,7 @@ export {
|
|
|
9489
9529
|
formatDateTime,
|
|
9490
9530
|
formatMessage,
|
|
9491
9531
|
formatNumber,
|
|
9532
|
+
getPasskey,
|
|
9492
9533
|
ghostCss,
|
|
9493
9534
|
groupKey,
|
|
9494
9535
|
heavierFirst,
|
|
@@ -9501,6 +9542,7 @@ export {
|
|
|
9501
9542
|
notify,
|
|
9502
9543
|
pageList,
|
|
9503
9544
|
partsOf,
|
|
9545
|
+
passkeysSupported,
|
|
9504
9546
|
pastedName,
|
|
9505
9547
|
placeCards,
|
|
9506
9548
|
placeItem,
|