@passflow/react 0.7.0 → 0.8.1

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.
Files changed (123) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/README.md +27 -17
  3. package/dist/index.cjs.js +2 -34
  4. package/dist/index.cjs.js.map +1 -1
  5. package/dist/index.es.js +123 -7308
  6. package/dist/index.es.js.map +1 -1
  7. package/dist/src/components/error/index.d.ts.map +1 -1
  8. package/dist/src/components/flow/device-verify/index.d.ts +10 -0
  9. package/dist/src/components/flow/device-verify/index.d.ts.map +1 -0
  10. package/dist/src/components/flow/device-verify/screen.d.ts +4 -0
  11. package/dist/src/components/flow/device-verify/screen.d.ts.map +1 -0
  12. package/dist/src/components/flow/index.d.ts +1 -0
  13. package/dist/src/components/flow/index.d.ts.map +1 -1
  14. package/dist/src/components/flow/passflow/index.d.ts.map +1 -1
  15. package/dist/src/components/flow/two-factor-verify/index.d.ts.map +1 -1
  16. package/dist/src/components/form/cli-auth/index.d.ts +8 -0
  17. package/dist/src/components/form/cli-auth/index.d.ts.map +1 -0
  18. package/dist/src/components/form/cli-auth/screen.d.ts +5 -0
  19. package/dist/src/components/form/cli-auth/screen.d.ts.map +1 -0
  20. package/dist/src/components/form/cli-browser-auth/index.d.ts.map +1 -1
  21. package/dist/src/components/form/cli-qr-auth/index.d.ts.map +1 -1
  22. package/dist/src/components/form/forgot-password/forgot-password-success.d.ts.map +1 -1
  23. package/dist/src/components/form/index.d.ts +0 -1
  24. package/dist/src/components/form/index.d.ts.map +1 -1
  25. package/dist/src/components/form/invitation-join/index.d.ts.map +1 -1
  26. package/dist/src/components/form/signin/index.d.ts +2 -2
  27. package/dist/src/components/form/signin/index.d.ts.map +1 -1
  28. package/dist/src/components/form/signup/index.d.ts +2 -2
  29. package/dist/src/components/form/signup/index.d.ts.map +1 -1
  30. package/dist/src/components/form/verify-challenge/verify-challenge-otp-redirect.d.ts.map +1 -1
  31. package/dist/src/components/form/verify-challenge/verify-challenge-otp.d.ts.map +1 -1
  32. package/dist/src/components/form/wrapper/index.d.ts +1 -12
  33. package/dist/src/components/form/wrapper/index.d.ts.map +1 -1
  34. package/dist/src/components/provider/passflow-provider.d.ts +22 -0
  35. package/dist/src/components/provider/passflow-provider.d.ts.map +1 -1
  36. package/dist/src/components/ui/country-flag/index.d.ts +7 -0
  37. package/dist/src/components/ui/country-flag/index.d.ts.map +1 -0
  38. package/dist/src/components/ui/country-flag/positions.d.ts +245 -0
  39. package/dist/src/components/ui/country-flag/positions.d.ts.map +1 -0
  40. package/dist/src/components/ui/fields/field-phone.d.ts +1 -1
  41. package/dist/src/components/ui/fields/field-phone.d.ts.map +1 -1
  42. package/dist/src/components/ui/icon/index.d.ts +3 -1
  43. package/dist/src/components/ui/icon/index.d.ts.map +1 -1
  44. package/dist/src/components/ui/index.d.ts +2 -0
  45. package/dist/src/components/ui/index.d.ts.map +1 -1
  46. package/dist/src/components/ui/login-screen/code-entry.d.ts +4 -0
  47. package/dist/src/components/ui/login-screen/code-entry.d.ts.map +1 -0
  48. package/dist/src/components/ui/login-screen/credentials.d.ts +4 -0
  49. package/dist/src/components/ui/login-screen/credentials.d.ts.map +1 -0
  50. package/dist/src/components/ui/login-screen/device-approval.d.ts +4 -0
  51. package/dist/src/components/ui/login-screen/device-approval.d.ts.map +1 -0
  52. package/dist/src/components/ui/login-screen/general-error.d.ts +4 -0
  53. package/dist/src/components/ui/login-screen/general-error.d.ts.map +1 -0
  54. package/dist/src/components/ui/login-screen/index.d.ts +4 -0
  55. package/dist/src/components/ui/login-screen/index.d.ts.map +1 -0
  56. package/dist/src/components/ui/login-screen/invitation.d.ts +4 -0
  57. package/dist/src/components/ui/login-screen/invitation.d.ts.map +1 -0
  58. package/dist/src/components/ui/login-screen/login-screen.d.ts +4 -0
  59. package/dist/src/components/ui/login-screen/login-screen.d.ts.map +1 -0
  60. package/dist/src/components/ui/login-screen/passkey-progress.d.ts +4 -0
  61. package/dist/src/components/ui/login-screen/passkey-progress.d.ts.map +1 -0
  62. package/dist/src/components/ui/login-screen/shared.d.ts +15 -0
  63. package/dist/src/components/ui/login-screen/shared.d.ts.map +1 -0
  64. package/dist/src/components/ui/login-screen/shell.d.ts +13 -0
  65. package/dist/src/components/ui/login-screen/shell.d.ts.map +1 -0
  66. package/dist/src/components/ui/login-screen/status.d.ts +4 -0
  67. package/dist/src/components/ui/login-screen/status.d.ts.map +1 -0
  68. package/dist/src/components/ui/login-screen/types.d.ts +153 -0
  69. package/dist/src/components/ui/login-screen/types.d.ts.map +1 -0
  70. package/dist/src/components/ui/switch/index.d.ts +1 -0
  71. package/dist/src/components/ui/switch/index.d.ts.map +1 -1
  72. package/dist/src/hooks/index.d.ts +1 -0
  73. package/dist/src/hooks/index.d.ts.map +1 -1
  74. package/dist/src/hooks/use-app-settings.d.ts.map +1 -1
  75. package/dist/src/hooks/use-device-verify.d.ts +79 -0
  76. package/dist/src/hooks/use-device-verify.d.ts.map +1 -0
  77. package/dist/src/hooks/use-join-invite.d.ts.map +1 -1
  78. package/dist/src/hooks/use-passwordless-complete.d.ts.map +1 -1
  79. package/dist/src/hooks/use-signin.d.ts +3 -2
  80. package/dist/src/hooks/use-signin.d.ts.map +1 -1
  81. package/dist/src/hooks/use-signup.d.ts +3 -2
  82. package/dist/src/hooks/use-signup.d.ts.map +1 -1
  83. package/dist/src/types/auth-errors.d.ts +8 -0
  84. package/dist/src/types/auth-errors.d.ts.map +1 -0
  85. package/dist/src/types/device-errors.d.ts +91 -0
  86. package/dist/src/types/device-errors.d.ts.map +1 -0
  87. package/dist/src/types/index.d.ts +2 -0
  88. package/dist/src/types/index.d.ts.map +1 -1
  89. package/dist/src/utils/auth-error.d.ts +7 -0
  90. package/dist/src/utils/auth-error.d.ts.map +1 -0
  91. package/dist/src/utils/classify-device-error.d.ts +35 -0
  92. package/dist/src/utils/classify-device-error.d.ts.map +1 -0
  93. package/dist/src/utils/index.d.ts +3 -0
  94. package/dist/src/utils/index.d.ts.map +1 -1
  95. package/dist/src/utils/invitation-auth-chrome.d.ts +8 -0
  96. package/dist/src/utils/invitation-auth-chrome.d.ts.map +1 -0
  97. package/dist/src/utils/login-theme.d.ts +8 -0
  98. package/dist/src/utils/login-theme.d.ts.map +1 -0
  99. package/dist/style.css +2 -1
  100. package/package.json +18 -10
  101. package/dist/playwright/fixture/index.d.ts +0 -3
  102. package/dist/playwright/fixture/index.d.ts.map +0 -1
  103. package/dist/playwright/playwright.config.d.ts +0 -10
  104. package/dist/playwright/playwright.config.d.ts.map +0 -1
  105. package/dist/playwright/tests/invitation-flow.spec.d.ts +0 -2
  106. package/dist/playwright/tests/invitation-flow.spec.d.ts.map +0 -1
  107. package/dist/playwright/tests/signin.spec.d.ts +0 -2
  108. package/dist/playwright/tests/signin.spec.d.ts.map +0 -1
  109. package/dist/playwright/tests/signup.spec.d.ts +0 -2
  110. package/dist/playwright/tests/signup.spec.d.ts.map +0 -1
  111. package/dist/playwright/tests/validate.spec.d.ts +0 -2
  112. package/dist/playwright/tests/validate.spec.d.ts.map +0 -1
  113. package/dist/src/app.d.ts +0 -5
  114. package/dist/src/app.d.ts.map +0 -1
  115. package/dist/src/main.d.ts +0 -1
  116. package/dist/src/main.d.ts.map +0 -1
  117. package/dist/src/test/setup.d.ts +0 -1
  118. package/dist/src/test/setup.d.ts.map +0 -1
  119. package/dist/src/test/utils/render.d.ts +0 -4
  120. package/dist/src/test/utils/render.d.ts.map +0 -1
  121. package/dist/src/test/utils/test-passflow.d.ts +0 -6
  122. package/dist/src/test/utils/test-passflow.d.ts.map +0 -1
  123. package/dist/vite.svg +0 -1
@@ -0,0 +1,4 @@
1
+ import { FC } from 'react';
2
+ import { LoginPasskeyProgressState } from './types';
3
+ export declare const LoginPasskeyProgress: FC<LoginPasskeyProgressState>;
4
+ //# sourceMappingURL=passkey-progress.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"passkey-progress.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/login-screen/passkey-progress.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAIhC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAEzD,eAAO,MAAM,oBAAoB,EAAE,EAAE,CAAC,yBAAyB,CA+B9D,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ import { LoginScreenNotice as LoginScreenNoticeProps } from './types';
3
+ export declare const LoginAlert: FC<{
4
+ message?: string | null;
5
+ id?: string;
6
+ }>;
7
+ export declare const LoginDivider: FC<{
8
+ label: string;
9
+ }>;
10
+ export declare const LoginActionStack: FC<PropsWithChildren>;
11
+ export declare const LoginProgress: FC<{
12
+ message: string;
13
+ }>;
14
+ export declare const LoginScreenNotice: FC<LoginScreenNoticeProps>;
15
+ //# sourceMappingURL=shared.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/login-screen/shared.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,KAAK,EAAE,iBAAiB,IAAI,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAE3E,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC;IAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,CASnE,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAM9C,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,iBAAiB,CAElD,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAKjD,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CAcxD,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ export type LoginScreenShellProps = PropsWithChildren & {
3
+ iconId?: string;
4
+ title?: string;
5
+ subtitle?: string;
6
+ className?: string;
7
+ customCss?: string;
8
+ customLogo?: string;
9
+ customLogoAlt?: string;
10
+ removeBranding?: boolean;
11
+ };
12
+ export declare const LoginScreenShell: FC<LoginScreenShellProps>;
13
+ //# sourceMappingURL=shell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/login-screen/shell.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAGnD,OAAO,oBAAoB,CAAC;AAC5B,OAAO,oBAAoB,CAAC;AAE5B,MAAM,MAAM,qBAAqB,GAAG,iBAAiB,GAAG;IACtD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CA2CtD,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { FC } from 'react';
2
+ import { LoginStatusState } from './types';
3
+ export declare const LoginStatus: FC<LoginStatusState>;
4
+ //# sourceMappingURL=status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/login-screen/status.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAIhC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAgC5C,CAAC"}
@@ -0,0 +1,153 @@
1
+ import { AuthUiError, DefaultMethod } from '../../../types';
2
+ import { PassflowPasswordPolicySettings, Providers } from '@passflow/core';
3
+ export type LoginScreenChrome = {
4
+ title: string;
5
+ subtitle?: string;
6
+ variant?: 'sign-in';
7
+ customCss?: string;
8
+ customLogo?: string;
9
+ customLogoAlt?: string;
10
+ removeBranding?: boolean;
11
+ };
12
+ export type LoginCredentialsValues = {
13
+ method: DefaultMethod | null;
14
+ emailOrUsername: string;
15
+ phone: string;
16
+ password: string;
17
+ };
18
+ export type LoginScreenLink = {
19
+ prompt: string;
20
+ label: string;
21
+ to: string;
22
+ search?: string;
23
+ };
24
+ export type LoginScreenNotice = {
25
+ code?: string;
26
+ appName: string;
27
+ message: string;
28
+ codeTestId?: string;
29
+ appNameTestId?: string;
30
+ };
31
+ export type LoginIdentityMethod = {
32
+ id: DefaultMethod;
33
+ label: string;
34
+ selectLabel: string;
35
+ requiredMessage: string;
36
+ format?: 'email';
37
+ password: boolean;
38
+ passwordlessLabel?: string;
39
+ };
40
+ export type LoginMethodConfig = {
41
+ identities: LoginIdentityMethod[];
42
+ passkey: boolean;
43
+ providers: Providers[];
44
+ };
45
+ export type LoginCredentialsState = {
46
+ kind: 'credentials';
47
+ methods: LoginMethodConfig;
48
+ passwordPolicy: PassflowPasswordPolicySettings | null;
49
+ credentialPurpose?: 'sign-in' | 'sign-up';
50
+ initialMethod?: DefaultMethod | null;
51
+ forcePasskey?: boolean;
52
+ allowPasskeyToggle?: boolean;
53
+ disabled?: boolean;
54
+ busy?: boolean;
55
+ error?: AuthUiError | null;
56
+ primaryLabel?: string;
57
+ passwordlessLabelPrefix?: string;
58
+ passkeyLabel?: string;
59
+ testId?: string;
60
+ primaryTestId?: string;
61
+ notice?: LoginScreenNotice;
62
+ forgotPassword?: {
63
+ to: string;
64
+ getSearch?: (method: DefaultMethod | null) => string;
65
+ };
66
+ footer?: LoginScreenLink;
67
+ onPassword?: (values: LoginCredentialsValues) => void;
68
+ onPasswordless?: (values: LoginCredentialsValues) => void;
69
+ onPasskey?: () => void;
70
+ onProvider?: (provider: Providers) => void;
71
+ onReset?: () => void;
72
+ };
73
+ export type LoginCodeEntryState = {
74
+ kind: 'code-entry';
75
+ label?: string;
76
+ initialCode?: string;
77
+ error?: string | null;
78
+ busy?: boolean;
79
+ submitLabel?: string;
80
+ testId?: string;
81
+ onSubmit: (code: string) => void;
82
+ };
83
+ export type LoginPasskeyProgressState = {
84
+ kind: 'passkey-progress';
85
+ working: boolean;
86
+ message: string;
87
+ actionLabel?: string;
88
+ error?: string | null;
89
+ recoverable?: boolean;
90
+ retryLabel?: string;
91
+ testId?: string;
92
+ onAction?: () => void;
93
+ onRetry?: () => void;
94
+ };
95
+ export type LoginDeviceApprovalState = {
96
+ kind: 'device-approval';
97
+ appName: string;
98
+ code?: string;
99
+ identity?: string | null;
100
+ busy?: boolean;
101
+ error?: string | null;
102
+ actionLabel?: string;
103
+ busyLabel?: string;
104
+ testId?: string;
105
+ actionTestId?: string;
106
+ codeTestId?: string;
107
+ appNameTestId?: string;
108
+ onApprove: () => void;
109
+ };
110
+ export type LoginInvitationState = {
111
+ kind: 'invitation';
112
+ identity?: string | null;
113
+ inviterName?: string | null;
114
+ busy?: boolean;
115
+ error?: string | null;
116
+ acceptLabel?: string;
117
+ busyLabel?: string;
118
+ switchAccountLabel?: string;
119
+ createAccountLabel?: string;
120
+ testId?: string;
121
+ acceptTestId?: string;
122
+ onAccept: () => void;
123
+ onSwitchAccount: () => void;
124
+ onCreateAccount: () => void;
125
+ };
126
+ export type LoginGeneralErrorState = {
127
+ kind: 'general-error';
128
+ message?: string;
129
+ detail?: string;
130
+ actionLabel?: string;
131
+ testId?: string;
132
+ onAction: () => void;
133
+ };
134
+ export type LoginStatusState = {
135
+ kind: 'status';
136
+ tone: 'success' | 'error' | 'disabled';
137
+ message: string;
138
+ detail?: string;
139
+ recoverable?: boolean;
140
+ retryLabel?: string;
141
+ testId?: string;
142
+ onRetry?: () => void;
143
+ primaryAction?: {
144
+ label: string;
145
+ onClick: () => void;
146
+ };
147
+ };
148
+ export type LoginScreenState = LoginCredentialsState | LoginCodeEntryState | LoginPasskeyProgressState | LoginDeviceApprovalState | LoginInvitationState | LoginGeneralErrorState | LoginStatusState;
149
+ export type LoginScreenProps = {
150
+ chrome: LoginScreenChrome;
151
+ state: LoginScreenState;
152
+ };
153
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/login-screen/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC1D,OAAO,KAAK,EAAE,8BAA8B,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,aAAa,GAAG,IAAI,CAAC;IAC7B,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EA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C;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,IAAI,EAAE,eAAe,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,SAAS,GAAG,OAAO,GAAG,UAAU,CAAC;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,aAAa,CAAC,EAAE;QACd,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,IAAI,CAAC;KACrB,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,gBAAgB,GACxB,qBAAqB,GACrB,mBAAmB,GACnB,yBAAyB,GACzB,wBAAwB,GACxB,oBAAoB,GACpB,sBAAsB,GACtB,gBAAgB,CAAC;AAErB,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,iBAAiB,CAAC;IAC1B,KAAK,EAAE,gBAAgB,CAAC;CACzB,CAAC"}
@@ -2,6 +2,7 @@ import { ChangeEvent, FC } from 'react';
2
2
  type TSwitch = {
3
3
  label: string;
4
4
  checked: boolean;
5
+ disabled?: boolean;
5
6
  onChange: (event: ChangeEvent<HTMLInputElement>) => void;
6
7
  };
7
8
  export declare const Switch: FC<TSwitch>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/switch/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAE7C,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;CAC1D,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,EAAE,CAAC,OAAO,CAM9B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/switch/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAE7C,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;CAC1D,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,EAAE,CAAC,OAAO,CAa9B,CAAC"}
@@ -22,4 +22,5 @@ export { useTwoFactorChallenge, type UseTwoFactorChallengeReturn } from './use-t
22
22
  export { useTwoFactorMethods, type UseTwoFactorMethodsReturn } from './use-two-factor-methods';
23
23
  export { useSessionExpired, type UseSessionExpiredOptions, type UseSessionExpiredResult, type SessionExpiredReason, } from './use-session-expired';
24
24
  export { useCLIAuth, type UseCLIAuthProps, type CLIAuthState } from './use-cli-auth';
25
+ export { useDeviceVerify, type UseDeviceVerifyProps, type DeviceVerifyStatus, type DeviceVerifyInfo, type DeviceUIMode, } from './use-device-verify';
25
26
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,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eviceError } from '../types/device-errors';
2
+ /**
3
+ * The RFC 8628 verification flow, as a hook.
4
+ *
5
+ * ── The one rule the whole thing is built around ────────────────────────────
6
+ * Signing in and approving are TWO ACTS, and this hook keeps them two. Proving
7
+ * who you are (`/oidc/device/authenticate`) yields an approval ticket and
8
+ * NOTHING else — no tokens, no session. Approving (`/oidc/device/approve`) is
9
+ * what releases tokens to the waiting terminal, and it needs that ticket.
10
+ *
11
+ * The gap between them is not ceremony, it is RFC 8628 §5.4: an attacker can
12
+ * start a device grant and walk a victim into approving it (STORM-2372). They
13
+ * know the user_code — they created it — and the page is public, so they can
14
+ * read its CSRF token too. Neither can be the authority for approval. Only the
15
+ * ticket, held in this hook's memory and bound to the browser that actually
16
+ * authenticated, can be.
17
+ *
18
+ * So: never collapse authenticate+approve into one call "for convenience".
19
+ * Mode 1 puts both behind one TAP (see confirmWithPassword) — that is a UI
20
+ * affordance and is fine, because the human still looked at the code first.
21
+ * Mode 3 skips the tap entirely, which it earns by using an origin-bound
22
+ * passkey; see the note on confirmWithPasskey.
23
+ */
24
+ /** The UI the server resolved for this challenge. A closed set — the client does not choose. */
25
+ export type DeviceUIMode = 'consent' | 'full_login' | 'passkey';
26
+ /** What GET /oidc/device/info hands the page to render itself. */
27
+ export type DeviceVerifyInfo = {
28
+ mode: DeviceUIMode;
29
+ /** Absent for `passkey` mode, by design — see device_page.go. */
30
+ user_code?: string;
31
+ app_name: string;
32
+ csrf_token: string;
33
+ methods: {
34
+ password: boolean;
35
+ passkey: boolean;
36
+ };
37
+ };
38
+ export type DeviceVerifyStatus =
39
+ /** Asking the server what to render. */
40
+ 'loading'
41
+ /** No code yet — show the entry form. */
42
+ | 'code_entry'
43
+ /** Info in hand; awaiting the user. */
44
+ | 'ready'
45
+ /** A call is in flight. */
46
+ | 'working'
47
+ /** Identity proven, ticket held, not yet approved. */
48
+ | 'signed_in'
49
+ /** Approved. The terminal has its tokens. */
50
+ | 'done'
51
+ /** The mode is switched off. Terminal, and nothing approvable is rendered. */
52
+ | 'refused'
53
+ /** Terminal failure — bad/expired code, dead app. */
54
+ | 'failed';
55
+ export type UseDeviceVerifyProps = {
56
+ status: DeviceVerifyStatus;
57
+ info: DeviceVerifyInfo | null;
58
+ error: DeviceError | null;
59
+ /** The email that authenticated, once one has. */
60
+ email: string | null;
61
+ /** Whether an approval ticket is held. */
62
+ isAuthenticated: boolean;
63
+ /** Re-run the info lookup for a code typed by hand. */
64
+ submitCode: (code: string) => void;
65
+ /** Prove identity with a password. Does NOT approve. */
66
+ signInWithPassword: (email: string, password: string) => Promise<void>;
67
+ /** Prove identity with a passkey. Does NOT approve. */
68
+ signInWithPasskey: () => Promise<void>;
69
+ /** Approve, using the ticket already held. */
70
+ approve: () => Promise<void>;
71
+ /** One tap: prove identity if needed, then approve. */
72
+ confirmWithPassword: (email: string, password: string) => Promise<void>;
73
+ /** Passkey ceremony then approve, with no tap in between. */
74
+ confirmWithPasskey: () => Promise<void>;
75
+ /** Clear a recoverable error so the user can try again. */
76
+ clearError: () => void;
77
+ };
78
+ export declare const useDeviceVerify: () => UseDeviceVerifyProps;
79
+ //# sourceMappingURL=use-device-verify.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-device-verify.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-device-verify.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAIzD;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,gGAAgG;AAChG,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,CAAC;AAEhE,kEAAkE;AAClE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,YAAY,CAAC;IACnB,iEAAiE;IACjE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE;QACP,QAAQ,EAAE,OAAO,CAAC;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d.ts","sourceRoot":"","sources":["../../../src/hooks/use-join-invite.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,kBAAkB,GAAG,MAAM;IACrC,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC3C,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,kBAwB3B,CAAC"}
1
+ {"version":3,"file":"use-join-invite.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-join-invite.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,kBAAkB,GAAG,MAAM;IACrC,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC3C,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,kBA4B3B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"use-passwordless-complete.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-passwordless-complete.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yCAAyC,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AAI5G,MAAM,MAAM,4BAA4B,GAAG,MAAM;IAC/C,KAAK,EAAE,CAAC,OAAO,EAAE,yCAAyC,KAAK,OAAO,CAAC,0BAA0B,GAAG,IAAI,CAAC,CAAC;IAC1G,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,4BAoCrC,CAAC"}
1
+ {"version":3,"file":"use-passwordless-complete.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-passwordless-complete.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,yCAAyC,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AAI5G,MAAM,MAAM,4BAA4B,GAAG,MAAM;IAC/C,KAAK,EAAE,CAAC,OAAO,EAAE,yCAAyC,KAAK,OAAO,CAAC,0BAA0B,GAAG,IAAI,CAAC,CAAC;IAC1G,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,4BAuCrC,CAAC"}
@@ -1,9 +1,10 @@
1
+ import { AuthOperation, AuthUiError } from '../types';
1
2
  import { PassflowPasskeyAuthenticateStartPayload, PassflowPasswordlessResponse, PassflowPasswordlessSignInPayload, PassflowSignInPayload } from '@passflow/core';
2
3
  export type UseSignInProps = () => {
3
- fetch: (payload: PassflowPasskeyAuthenticateStartPayload | PassflowSignInPayload | PassflowPasswordlessSignInPayload, type: 'passkey' | 'password' | 'passwordless') => Promise<boolean | string | PassflowPasswordlessResponse>;
4
+ fetch: (payload: PassflowPasskeyAuthenticateStartPayload | PassflowSignInPayload | PassflowPasswordlessSignInPayload, type: AuthOperation) => Promise<boolean | string | PassflowPasswordlessResponse>;
4
5
  isLoading: boolean;
5
6
  isError: boolean;
6
- error: string;
7
+ error: AuthUiError | null;
7
8
  reset: () => void;
8
9
  };
9
10
  export declare const useSignIn: UseSignInProps;
@@ -1 +1 @@
1
- {"version":3,"file":"use-signin.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-signin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uCAAuC,EACvC,4BAA4B,EAC5B,iCAAiC,EACjC,qBAAqB,EACtB,MAAM,gBAAgB,CAAC;AAIxB,MAAM,MAAM,cAAc,GAAG,MAAM;IACjC,KAAK,EAAE,CACL,OAAO,EAAE,uCAAuC,GAAG,qBAAqB,GAAG,iCAAiC,EAC5G,IAAI,EAAE,SAAS,GAAG,UAAU,GAAG,cAAc,KAC1C,OAAO,CAAC,OAAO,GAAG,MAAM,GAAG,4BAA4B,CAAC,CAAC;IAC9D,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,cA0CvB,CAAC"}
1
+ {"version":3,"file":"use-signin.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-signin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE1D,OAAO,KAAK,EACV,uCAAuC,EACvC,4BAA4B,EAC5B,iCAAiC,EACjC,qBAAqB,EACtB,MAAM,gBAAgB,CAAC;AAIxB,MAAM,MAAM,cAAc,GAAG,MAAM;IACjC,KAAK,EAAE,CACL,OAAO,EAAE,uCAAuC,GAAG,qBAAqB,GAAG,iCAAiC,EAC5G,IAAI,EAAE,aAAa,KAChB,OAAO,CAAC,OAAO,GAAG,MAAM,GAAG,4BAA4B,CAAC,CAAC;IAC9D,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,WAAW,GAAG,IAAI,CAAC;IAC1B,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,cA4CvB,CAAC"}
@@ -1,9 +1,10 @@
1
+ import { AuthOperation, AuthUiError } from '../types';
1
2
  import { PassflowPasskeyRegisterStartPayload, PassflowPasswordlessResponse, PassflowPasswordlessSignInPayload, PassflowSignUpPayload } from '@passflow/core';
2
3
  export type UseSignUpProps = () => {
3
- fetch: (payload: PassflowPasskeyRegisterStartPayload | PassflowSignUpPayload | PassflowPasswordlessSignInPayload, type: 'passkey' | 'password' | 'passwordless') => Promise<boolean | string | PassflowPasswordlessResponse>;
4
+ fetch: (payload: PassflowPasskeyRegisterStartPayload | PassflowSignUpPayload | PassflowPasswordlessSignInPayload, type: AuthOperation) => Promise<boolean | string | PassflowPasswordlessResponse>;
4
5
  isLoading: boolean;
5
6
  isError: boolean;
6
- error: string;
7
+ error: AuthUiError | null;
7
8
  reset: () => void;
8
9
  };
9
10
  export declare const useSignUp: UseSignUpProps;
@@ -1 +1 @@
1
- {"version":3,"file":"use-signup.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-signup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mCAAmC,EACnC,4BAA4B,EAC5B,iCAAiC,EACjC,qBAAqB,EACtB,MAAM,gBAAgB,CAAC;AAIxB,MAAM,MAAM,cAAc,GAAG,MAAM;IACjC,KAAK,EAAE,CACL,OAAO,EAAE,mCAAmC,GAAG,qBAAqB,GAAG,iCAAiC,EACxG,IAAI,EAAE,SAAS,GAAG,UAAU,GAAG,cAAc,KAC1C,OAAO,CAAC,OAAO,GAAG,MAAM,GAAG,4BAA4B,CAAC,CAAC;IAC9D,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,cA6CvB,CAAC"}
1
+ {"version":3,"file":"use-signup.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-signup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE1D,OAAO,KAAK,EACV,mCAAmC,EACnC,4BAA4B,EAC5B,iCAAiC,EACjC,qBAAqB,EACtB,MAAM,gBAAgB,CAAC;AAIxB,MAAM,MAAM,cAAc,GAAG,MAAM;IACjC,KAAK,EAAE,CACL,OAAO,EAAE,mCAAmC,GAAG,qBAAqB,GAAG,iCAAiC,EACxG,IAAI,EAAE,aAAa,KAChB,OAAO,CAAC,OAAO,GAAG,MAAM,GAAG,4BAA4B,CAAC,CAAC;IAC9D,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,WAAW,GAAG,IAAI,CAAC;IAC1B,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,cA+CvB,CAAC"}
@@ -0,0 +1,8 @@
1
+ export type AuthErrorScope = 'form' | 'identity' | 'password' | 'credentials';
2
+ export type AuthUiError = {
3
+ message: string;
4
+ scope: AuthErrorScope;
5
+ };
6
+ export type AuthOperation = 'password' | 'passwordless' | 'passkey';
7
+ export type AuthFlow = 'sign-in' | 'sign-up';
8
+ //# sourceMappingURL=auth-errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth-errors.d.ts","sourceRoot":"","sources":["../../../src/types/auth-errors.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,GAAG,aAAa,CAAC;AAE9E,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,cAAc,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,cAAc,GAAG,SAAS,CAAC;AACpE,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC"}
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Error taxonomy for the RFC 8628 device verification flow.
3
+ *
4
+ * ── The rule this file exists to enforce ────────────────────────────────────
5
+ * The person on this screen has just scanned a QR code with their phone and is
6
+ * deciding whether to hand a terminal a token. They are not debugging us. So:
7
+ *
8
+ * the message a user reads is NEVER a string we did not write for them.
9
+ *
10
+ * Not the browser's. Not the server's `error_description`. Not an exception's
11
+ * `.message`. Those are written for operators and they leak — the screen this
12
+ * taxonomy replaced did `err.message ?? 'Something went wrong'` and duly showed
13
+ * a real user:
14
+ *
15
+ * "Resident credentials or empty 'allowCredentials' lists are not
16
+ * supported at this time."
17
+ *
18
+ * — a Chrome/CDP internal, about a spec feature, in the middle of a sign-in.
19
+ *
20
+ * The technical string is not thrown away; it is just demoted. It rides along
21
+ * in `detail`, which the UI logs to the console and may offer behind a
22
+ * "details" affordance, and which the server also has in its own logs. Diagnosis
23
+ * keeps everything. The user keeps their sentence.
24
+ */
25
+ /**
26
+ * The closed set of things that can go wrong on the verification page, at the
27
+ * granularity a USER can act on.
28
+ *
29
+ * Deliberately coarser than the causes. Several distinct WebAuthn failures
30
+ * collapse into `passkey_failed` because the remedy is identical ("try again or
31
+ * use another method") and because the browser itself refuses to distinguish
32
+ * them — Chrome reports "you cancelled", "you timed out" and "there is no
33
+ * credential here" all as NotAllowedError, on purpose, so that a page cannot use
34
+ * the ceremony as an oracle for which accounts exist on a device. Inventing a
35
+ * finer story for the user than the browser told us would mean guessing.
36
+ */
37
+ export type DeviceErrorType =
38
+ /** No user_code supplied yet — show the code entry form, not an error. */
39
+ 'code_required'
40
+ /** The code is wrong, malformed, or names nothing. */
41
+ | 'code_invalid'
42
+ /** The code was real and has expired. */
43
+ | 'code_expired'
44
+ /** This request was already declined. */
45
+ | 'code_declined'
46
+ /** Already approved — the terminal already has what it needs. */
47
+ | 'code_already_approved'
48
+ /** RFC 8628 §5.1 budget spent. */
49
+ | 'too_many_attempts'
50
+ /** The app owner has this sign-in mode switched off. Renders the refusal. */
51
+ | 'mode_disabled'
52
+ /** The requesting app is gone, or its sign-in method is not configured. */
53
+ | 'app_unavailable'
54
+ /** Wrong email or password. */
55
+ | 'bad_credentials'
56
+ /** The form was submitted empty. */
57
+ | 'missing_credentials'
58
+ /** The account is blocked. */
59
+ | 'account_blocked'
60
+ /** The passkey ceremony did not complete: cancelled, timed out, or none found. */
61
+ | 'passkey_failed'
62
+ /** This browser/authenticator cannot do this passkey sign-in at all. */
63
+ | 'passkey_unsupported'
64
+ /** We could not reach the server. */
65
+ | 'offline'
66
+ /** Anything else — including every technical failure the user cannot act on. */
67
+ | 'generic';
68
+ /**
69
+ * A classified failure: one sentence for the human, everything else for us.
70
+ */
71
+ export type DeviceError = {
72
+ type: DeviceErrorType;
73
+ /**
74
+ * Plain, human, safe to render. Written by us, for this screen. Never
75
+ * interpolated from an exception or a server description.
76
+ */
77
+ message: string;
78
+ /**
79
+ * The technical string — an exception message, a server `error_description`,
80
+ * a DOMException name. For the console, a collapsed details affordance, and
81
+ * bug reports. MUST NOT be shown as the primary message.
82
+ */
83
+ detail?: string;
84
+ /**
85
+ * Whether trying again on this page could plausibly work. Drives whether a
86
+ * retry control is offered: `false` means the page must not invite the user
87
+ * to bang on it (an expired code will never become unexpired here).
88
+ */
89
+ isRecoverable: boolean;
90
+ };
91
+ //# sourceMappingURL=device-errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"device-errors.d.ts","sourceRoot":"","sources":["../../../src/types/device-errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,eAAe;AACzB,0EAA0E;AACxE,eAAe;AACjB,sDAAsD;GACpD,cAAc;AAChB,yCAAyC;GACvC,cAAc;AAChB,yCAAyC;GACvC,eAAe;AACjB,iEAAiE;GAC/D,uBAAuB;AACzB,kCAAkC;GAChC,mBAAmB;AACrB,6EAA6E;GAC3E,eAAe;AACjB,2EAA2E;GACzE,iBAAiB;AACnB,+BAA+B;GAC7B,iBAAiB;AACnB,oCAAoC;GAClC,qBAAqB;AACvB,8BAA8B;GAC5B,iBAAiB;AACnB,kFAAkF;GAChF,gBAAgB;AAClB,wEAAwE;GACtE,qBAAqB;AACvB,qCAAqC;GACnC,SAAS;AACX,gFAAgF;GAC9E,SAAS,CAAC;AAEd;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,eAAe,CAAC;IACtB;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,aAAa,EAAE,OAAO,CAAC;CACxB,CAAC"}
@@ -3,6 +3,8 @@ export type DefaultMethod = 'email_or_username' | 'phone';
3
3
  export type PreferChallenge = 'passkey' | 'password' | 'otp' | 'magic_link';
4
4
  export type SuccessAuthRedirect = string;
5
5
  export type { TwoFactorErrorType, TwoFactorError } from './two-factor-errors';
6
+ export type { DeviceErrorType, DeviceError } from './device-errors';
7
+ export type { AuthErrorScope, AuthFlow, AuthOperation, AuthUiError } from './auth-errors';
6
8
  export type { TwoFactorMethod, TwoFactorChallengeResponse, RegisteredTwoFactorMethod, TwoFactorVerifyRequestV2, TwoFactorVerifyResponseV2, } from '@passflow/core';
7
9
  export interface UseTwoFactorChallengeReturn {
8
10
  challenge: import('@passflow/core').TwoFactorChallengeResponse | null;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,OAAO,GAAG,MAAM,CAAC;AAE3D,MAAM,MAAM,aAAa,GAAG,mBAAmB,GAAG,OAAO,CAAC;AAE1D,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,UAAU,GAAG,KAAK,GAAG,YAAY,CAAC;AAE5E,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC;AAEzC,YAAY,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAG9E,YAAY,EACV,eAAe,EACf,0BAA0B,EAC1B,yBAAyB,EACzB,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,gBAAgB,CAAC;AAGxB,MAAM,WAAW,2BAA2B;IAC1C,SAAS,EAAE,OAAO,gBAAgB,EAAE,0BAA0B,GAAG,IAAI,CAAC;IACtE,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,E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AE,QAAQ,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG1F,YAAY,EACV,eAAe,EACf,0BAA0B,EAC1B,yBAAyB,EACzB,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,gBAAgB,CAAC;AAGxB,MAAM,WAAW,2BAA2B;IAC1C,SAAS,EAAE,OAAO,gBAAgB,EAAE,0BAA0B,GAAG,IAAI,CAAC;IACtE,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,gBAAgB,EAAE,CAAC,iBAAiB,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAChE,MAAM,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACnE,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,gBAAgB,EAAE,eAAe,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAClF,cAAc,EAAE,OAAO,gBAAgB,EAAE,eAAe,GAAG,IAAI,CAAC;CACjE;AAED,MAAM,WAAW,yBAAyB;IACxC,gBAAgB,EAAE,OAAO,gBAAgB,EAAE,eAAe,EAAE,CAAC;IAC7D,iBAAiB,EAAE,OAAO,gBAAgB,EAAE,yBAAyB,EAAE,CAAC;IACxE,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,YAAY,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACnD"}
@@ -0,0 +1,7 @@
1
+ import { AuthFlow, AuthOperation, AuthUiError } from '../types';
2
+ export declare const authRedirectErrorMessage = "We couldn't continue this authentication request. Return to the app and try again.";
3
+ export declare const verificationLinkErrorMessage = "This verification link is invalid or incomplete. Request a new link or code and try again.";
4
+ export declare const invitationLinkErrorMessage = "This invitation link is invalid or has expired.";
5
+ export declare const verificationRequestErrorMessage = "This verification request is no longer available. Start again to request a new link or code.";
6
+ export declare const authErrorFor: (flow: AuthFlow, operation: AuthOperation) => AuthUiError;
7
+ //# sourceMappingURL=auth-error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth-error.d.ts","sourceRoot":"","sources":["../../../src/utils/auth-error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAiCpE,eAAO,MAAM,wBAAwB,uFAAuF,CAAC;AAE7H,eAAO,MAAM,4BAA4B,+FACqD,CAAC;AAE/F,eAAO,MAAM,0BAA0B,oDAAoD,CAAC;AAE5F,eAAO,MAAM,+BAA+B,iGACoD,CAAC;AAEjG,eAAO,MAAM,YAAY,GAAI,MAAM,QAAQ,EAAE,WAAW,aAAa,KAAG,WAA+C,CAAC"}
@@ -0,0 +1,35 @@
1
+ import { DeviceError, DeviceErrorType } from '../types/device-errors';
2
+ /**
3
+ * An error carrying a server-supplied reason code. Thrown by the device API
4
+ * client so the classifier can map precisely rather than sniff strings.
5
+ */
6
+ export declare class DeviceApiError extends Error {
7
+ /** Stable machine reason from the server. */
8
+ readonly reason: string;
9
+ /** The OAuth2 error code (`invalid_request`, `unauthorized_client`, ...). */
10
+ readonly code: string;
11
+ /** HTTP status. */
12
+ readonly status: number;
13
+ constructor(params: {
14
+ reason: string;
15
+ code: string;
16
+ status: number;
17
+ description: string;
18
+ });
19
+ }
20
+ /**
21
+ * Classify any failure from the device verification flow.
22
+ *
23
+ * Order matters: the server's own reason wins when we have one (it knows more
24
+ * than we can infer), then WebAuthn's message text, then WebAuthn's name, then
25
+ * the network, then a safe default. Every path ends in copy from
26
+ * DEVICE_ERROR_COPY — there is deliberately no branch that forwards a raw
27
+ * string to `message`.
28
+ */
29
+ export declare function classifyDeviceError(err: unknown): DeviceError;
30
+ /**
31
+ * The copy for a type, without an error to classify. For states that are known
32
+ * up front rather than thrown — e.g. a browser with no WebAuthn at all.
33
+ */
34
+ export declare function deviceErrorOfType(type: DeviceErrorType, detail?: string): DeviceError;
35
+ //# sourceMappingURL=classify-device-error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"classify-device-error.d.ts","sourceRoot":"","sources":["../../../src/utils/classify-device-error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAyI1E;;;GAGG;AACH,qBAAa,cAAe,SAAQ,KAAK;IACvC,6CAA6C;IAC7C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,6EAA6E;IAC7E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,mBAAmB;IACnB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEZ,MAAM,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE;CAS1F;AAYD;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,WAAW,CAmC7D;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,eAAe,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,WAAW,CAErF"}
@@ -9,5 +9,8 @@ export { getIdentityLabel, getPasswordlessData, getValidationErrorsLabel } from
9
9
  export { useUrlParams } from './url-params';
10
10
  export { getUrlErrors } from './get-url-errors';
11
11
  export { classifyTwoFactorError, getUserFriendlyErrorMessage } from './classify-two-factor-error';
12
+ export { classifyDeviceError, deviceErrorOfType, DeviceApiError } from './classify-device-error';
13
+ export { authErrorFor, authRedirectErrorMessage, invitationLinkErrorMessage, verificationLinkErrorMessage, verificationRequestErrorMessage, } from './auth-error';
14
+ export { getInvitationAuthChrome, type InvitationAuthIntent } from './invitation-auth-chrome';
12
15
  export { TwoFactorLoopPrevention } from './two-factor-loop-prevention';
13
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC9E,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AACpG,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAClG,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC9E,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AACpG,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAClG,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACjG,OAAO,EACL,YAAY,EACZ,wBAAwB,EACxB,0BAA0B,EAC1B,4BAA4B,EAC5B,+BAA+B,GAChC,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,uBAAuB,EAAE,KAAK,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAC9F,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC"}
@@ -0,0 +1,8 @@
1
+ export type InvitationAuthIntent = 'sign-in' | 'sign-up';
2
+ type InvitationAuthChrome = {
3
+ title: string;
4
+ subtitle: string;
5
+ };
6
+ export declare const getInvitationAuthChrome: (inviteToken: string | null | undefined, intent: InvitationAuthIntent) => InvitationAuthChrome | null;
7
+ export {};
8
+ //# sourceMappingURL=invitation-auth-chrome.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invitation-auth-chrome.d.ts","sourceRoot":"","sources":["../../../src/utils/invitation-auth-chrome.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,SAAS,CAAC;AAEzD,KAAK,oBAAoB,GAAG;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAaF,eAAO,MAAM,uBAAuB,GAClC,aAAa,MAAM,GAAG,IAAI,GAAG,SAAS,EACtC,QAAQ,oBAAoB,KAC3B,oBAAoB,GAAG,IAczB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { LoginWebAppStyle } from '@passflow/core';
2
+ export type CompatibleLoginWebAppStyle = Partial<LoginWebAppStyle> & {
3
+ /** Legacy field used by themes created before text_color was introduced. */
4
+ content_color?: string;
5
+ };
6
+ export declare const getLoginThemeCssVariables: (style: CompatibleLoginWebAppStyle) => Record<string, string | null>;
7
+ export declare const applyLoginThemeStyles: (root: HTMLElement, style: CompatibleLoginWebAppStyle) => void;
8
+ //# sourceMappingURL=login-theme.d.ts.map