@passflow/react 0.14.0 → 0.15.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 (377) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/README.md +29 -16
  3. package/dist/index.cjs +2 -0
  4. package/dist/index.cjs.map +1 -0
  5. package/dist/index.es.js +143 -143
  6. package/dist/index.es.js.map +1 -1
  7. package/dist/src/components/error/index.d.cts +7 -0
  8. package/dist/src/components/error/index.d.ts +1 -1
  9. package/dist/src/components/error/index.d.ts.map +1 -1
  10. package/dist/src/components/flow/consent/index.d.cts +13 -0
  11. package/dist/src/components/flow/consent/index.d.ts +1 -1
  12. package/dist/src/components/flow/consent/index.d.ts.map +1 -1
  13. package/dist/src/components/flow/consent/screen.d.cts +9 -0
  14. package/dist/src/components/flow/consent/screen.d.ts +2 -2
  15. package/dist/src/components/flow/consent/screen.d.ts.map +1 -1
  16. package/dist/src/components/flow/device-verify/index.d.cts +10 -0
  17. package/dist/src/components/flow/device-verify/index.d.ts +1 -1
  18. package/dist/src/components/flow/device-verify/index.d.ts.map +1 -1
  19. package/dist/src/components/flow/device-verify/screen.d.cts +4 -0
  20. package/dist/src/components/flow/device-verify/screen.d.ts +2 -2
  21. package/dist/src/components/flow/device-verify/screen.d.ts.map +1 -1
  22. package/dist/src/components/flow/index.d.cts +5 -0
  23. package/dist/src/components/flow/index.d.ts +4 -4
  24. package/dist/src/components/flow/index.d.ts.map +1 -1
  25. package/dist/src/components/flow/passflow/index.d.cts +16 -0
  26. package/dist/src/components/flow/passflow/index.d.ts +5 -1
  27. package/dist/src/components/flow/passflow/index.d.ts.map +1 -1
  28. package/dist/src/components/flow/two-factor-setup/index.d.cts +10 -0
  29. package/dist/src/components/flow/two-factor-setup/index.d.ts +2 -2
  30. package/dist/src/components/flow/two-factor-setup/index.d.ts.map +1 -1
  31. package/dist/src/components/flow/two-factor-setup-magic-link/index.d.cts +35 -0
  32. package/dist/src/components/flow/two-factor-setup-magic-link/index.d.ts +2 -2
  33. package/dist/src/components/flow/two-factor-setup-magic-link/index.d.ts.map +1 -1
  34. package/dist/src/components/flow/two-factor-verify/index.d.cts +11 -0
  35. package/dist/src/components/flow/two-factor-verify/index.d.ts +2 -2
  36. package/dist/src/components/flow/two-factor-verify/index.d.ts.map +1 -1
  37. package/dist/src/components/form/forgot-password/forgot-password-success.d.cts +2 -0
  38. package/dist/src/components/form/forgot-password/forgot-password-success.d.ts +1 -1
  39. package/dist/src/components/form/forgot-password/forgot-password-success.d.ts.map +1 -1
  40. package/dist/src/components/form/forgot-password/forgot-password.d.cts +9 -0
  41. package/dist/src/components/form/forgot-password/forgot-password.d.ts +1 -1
  42. package/dist/src/components/form/forgot-password/forgot-password.d.ts.map +1 -1
  43. package/dist/src/components/form/forgot-password/index.d.cts +3 -0
  44. package/dist/src/components/form/forgot-password/index.d.ts +2 -2
  45. package/dist/src/components/form/index.d.cts +10 -0
  46. package/dist/src/components/form/index.d.ts +9 -9
  47. package/dist/src/components/form/index.d.ts.map +1 -1
  48. package/dist/src/components/form/invitation-join/index.d.cts +7 -0
  49. package/dist/src/components/form/invitation-join/index.d.ts +1 -2
  50. package/dist/src/components/form/invitation-join/index.d.ts.map +1 -1
  51. package/dist/src/components/form/reset-password/index.d.cts +9 -0
  52. package/dist/src/components/form/reset-password/index.d.ts +2 -2
  53. package/dist/src/components/form/reset-password/index.d.ts.map +1 -1
  54. package/dist/src/components/form/signin/index.d.cts +15 -0
  55. package/dist/src/components/form/signin/index.d.ts +2 -2
  56. package/dist/src/components/form/signin/index.d.ts.map +1 -1
  57. package/dist/src/components/form/signup/index.d.cts +14 -0
  58. package/dist/src/components/form/signup/index.d.ts +2 -2
  59. package/dist/src/components/form/signup/index.d.ts.map +1 -1
  60. package/dist/src/components/form/two-factor-challenge/index.d.cts +10 -0
  61. package/dist/src/components/form/two-factor-challenge/index.d.ts +1 -1
  62. package/dist/src/components/form/two-factor-challenge/index.d.ts.map +1 -1
  63. package/dist/src/components/form/two-factor-challenge/method-selector.d.cts +12 -0
  64. package/dist/src/components/form/two-factor-challenge/method-selector.d.ts +2 -2
  65. package/dist/src/components/form/two-factor-setup/index.d.cts +2 -0
  66. package/dist/src/components/form/two-factor-setup/index.d.ts +1 -1
  67. package/dist/src/components/form/two-factor-setup/two-factor-setup-form.d.cts +9 -0
  68. package/dist/src/components/form/two-factor-setup/two-factor-setup-form.d.ts +1 -1
  69. package/dist/src/components/form/two-factor-setup/two-factor-setup-form.d.ts.map +1 -1
  70. package/dist/src/components/form/two-factor-verify/index.d.cts +3 -0
  71. package/dist/src/components/form/two-factor-verify/index.d.ts +2 -2
  72. package/dist/src/components/form/two-factor-verify/index.d.ts.map +1 -1
  73. package/dist/src/components/form/two-factor-verify/two-factor-recovery-form.d.cts +13 -0
  74. package/dist/src/components/form/two-factor-verify/two-factor-recovery-form.d.ts +1 -1
  75. package/dist/src/components/form/two-factor-verify/two-factor-recovery-form.d.ts.map +1 -1
  76. package/dist/src/components/form/two-factor-verify/two-factor-verify-form.d.cts +16 -0
  77. package/dist/src/components/form/two-factor-verify/two-factor-verify-form.d.ts +1 -1
  78. package/dist/src/components/form/two-factor-verify/two-factor-verify-form.d.ts.map +1 -1
  79. package/dist/src/components/form/verify-challenge/index.d.cts +3 -0
  80. package/dist/src/components/form/verify-challenge/index.d.ts +2 -2
  81. package/dist/src/components/form/verify-challenge/timer-button.d.cts +9 -0
  82. package/dist/src/components/form/verify-challenge/timer-button.d.ts +1 -1
  83. package/dist/src/components/form/verify-challenge/timer-button.d.ts.map +1 -1
  84. package/dist/src/components/form/verify-challenge/verify-challenge-magic-link.d.cts +2 -0
  85. package/dist/src/components/form/verify-challenge/verify-challenge-magic-link.d.ts +1 -1
  86. package/dist/src/components/form/verify-challenge/verify-challenge-magic-link.d.ts.map +1 -1
  87. package/dist/src/components/form/verify-challenge/verify-challenge-otp-manual.d.cts +16 -0
  88. package/dist/src/components/form/verify-challenge/verify-challenge-otp-manual.d.ts +1 -1
  89. package/dist/src/components/form/verify-challenge/verify-challenge-otp-manual.d.ts.map +1 -1
  90. package/dist/src/components/form/verify-challenge/verify-challenge-otp-redirect.d.cts +9 -0
  91. package/dist/src/components/form/verify-challenge/verify-challenge-otp-redirect.d.ts +1 -2
  92. package/dist/src/components/form/verify-challenge/verify-challenge-otp-redirect.d.ts.map +1 -1
  93. package/dist/src/components/form/verify-challenge/verify-challenge-otp.d.cts +12 -0
  94. package/dist/src/components/form/verify-challenge/verify-challenge-otp.d.ts +2 -2
  95. package/dist/src/components/form/verify-challenge/verify-challenge-otp.d.ts.map +1 -1
  96. package/dist/src/components/form/verify-challenge/verify-challenge-success.d.cts +3 -0
  97. package/dist/src/components/form/verify-challenge/verify-challenge-success.d.ts +1 -1
  98. package/dist/src/components/form/verify-challenge/verify-challenge-success.d.ts.map +1 -1
  99. package/dist/src/components/form/wrapper/index.d.cts +2 -0
  100. package/dist/src/components/form/wrapper/index.d.ts +1 -1
  101. package/dist/src/components/passkey/index.d.cts +7 -0
  102. package/dist/src/components/passkey/index.d.ts +1 -1
  103. package/dist/src/components/passkey/index.d.ts.map +1 -1
  104. package/dist/src/components/passkey/passkey-actions.d.cts +13 -0
  105. package/dist/src/components/passkey/passkey-actions.d.ts +1 -1
  106. package/dist/src/components/passkey/passkey-actions.d.ts.map +1 -1
  107. package/dist/src/components/passkey/passkey-dialog.d.cts +10 -0
  108. package/dist/src/components/passkey/passkey-dialog.d.ts +1 -1
  109. package/dist/src/components/passkey/passkey-list.d.cts +9 -0
  110. package/dist/src/components/passkey/passkey-list.d.ts +2 -2
  111. package/dist/src/components/passkey/passkey-list.d.ts.map +1 -1
  112. package/dist/src/components/provider/index.d.cts +4 -0
  113. package/dist/src/components/provider/index.d.ts +3 -3
  114. package/dist/src/components/provider/index.d.ts.map +1 -1
  115. package/dist/src/components/provider/passflow-provider.d.cts +160 -0
  116. package/dist/src/components/provider/passflow-provider.d.ts +4 -4
  117. package/dist/src/components/provider/passflow-provider.d.ts.map +1 -1
  118. package/dist/src/components/provider/upgrade-provider.d.cts +85 -0
  119. package/dist/src/components/provider/upgrade-provider.d.ts +39 -3
  120. package/dist/src/components/provider/upgrade-provider.d.ts.map +1 -1
  121. package/dist/src/components/ui/button/index.d.cts +34 -0
  122. package/dist/src/components/ui/button/index.d.ts +3 -2
  123. package/dist/src/components/ui/button/index.d.ts.map +1 -1
  124. package/dist/src/components/ui/continuing-status/index.d.cts +8 -0
  125. package/dist/src/components/ui/continuing-status/index.d.ts +1 -1
  126. package/dist/src/components/ui/country-flag/index.d.cts +7 -0
  127. package/dist/src/components/ui/country-flag/index.d.ts +1 -1
  128. package/dist/src/components/ui/country-flag/index.d.ts.map +1 -1
  129. package/dist/src/components/ui/country-flag/positions.d.cts +245 -0
  130. package/dist/src/components/ui/country-flag/positions.d.ts +241 -241
  131. package/dist/src/components/ui/country-flag/positions.d.ts.map +1 -1
  132. package/dist/src/components/ui/dialog/index.d.cts +20 -0
  133. package/dist/src/components/ui/dialog/index.d.ts +18 -18
  134. package/dist/src/components/ui/dialog/index.d.ts.map +1 -1
  135. package/dist/src/components/ui/fields/field-otp.d.cts +48 -0
  136. package/dist/src/components/ui/fields/field-otp.d.ts +48 -0
  137. package/dist/src/components/ui/fields/field-otp.d.ts.map +1 -0
  138. package/dist/src/components/ui/fields/field-password.d.cts +13 -0
  139. package/dist/src/components/ui/fields/field-password.d.ts +4 -4
  140. package/dist/src/components/ui/fields/field-password.d.ts.map +1 -1
  141. package/dist/src/components/ui/fields/field-phone.d.cts +11 -0
  142. package/dist/src/components/ui/fields/field-phone.d.ts +1 -1
  143. package/dist/src/components/ui/fields/field-phone.d.ts.map +1 -1
  144. package/dist/src/components/ui/fields/field-text.d.cts +8 -0
  145. package/dist/src/components/ui/fields/field-text.d.ts +3 -3
  146. package/dist/src/components/ui/fields/field-text.d.ts.map +1 -1
  147. package/dist/src/components/ui/fields/index.d.cts +5 -0
  148. package/dist/src/components/ui/fields/index.d.ts +4 -3
  149. package/dist/src/components/ui/fields/index.d.ts.map +1 -1
  150. package/dist/src/components/ui/icon/index.d.cts +11 -0
  151. package/dist/src/components/ui/icon/index.d.ts +1 -1
  152. package/dist/src/components/ui/icon/index.d.ts.map +1 -1
  153. package/dist/src/components/ui/index.d.cts +14 -0
  154. package/dist/src/components/ui/index.d.ts +13 -13
  155. package/dist/src/components/ui/index.d.ts.map +1 -1
  156. package/dist/src/components/ui/link/index.d.cts +11 -0
  157. package/dist/src/components/ui/link/index.d.ts +1 -1
  158. package/dist/src/components/ui/link/index.d.ts.map +1 -1
  159. package/dist/src/components/ui/login-screen/code-entry.d.cts +4 -0
  160. package/dist/src/components/ui/login-screen/code-entry.d.ts +2 -2
  161. package/dist/src/components/ui/login-screen/consent.d.cts +15 -0
  162. package/dist/src/components/ui/login-screen/consent.d.ts +2 -2
  163. package/dist/src/components/ui/login-screen/credentials.d.cts +4 -0
  164. package/dist/src/components/ui/login-screen/credentials.d.ts +2 -2
  165. package/dist/src/components/ui/login-screen/credentials.d.ts.map +1 -1
  166. package/dist/src/components/ui/login-screen/device-approval.d.cts +4 -0
  167. package/dist/src/components/ui/login-screen/device-approval.d.ts +2 -2
  168. package/dist/src/components/ui/login-screen/general-error.d.cts +4 -0
  169. package/dist/src/components/ui/login-screen/general-error.d.ts +2 -2
  170. package/dist/src/components/ui/login-screen/index.d.cts +4 -0
  171. package/dist/src/components/ui/login-screen/index.d.ts +3 -3
  172. package/dist/src/components/ui/login-screen/index.d.ts.map +1 -1
  173. package/dist/src/components/ui/login-screen/invitation.d.cts +4 -0
  174. package/dist/src/components/ui/login-screen/invitation.d.ts +2 -2
  175. package/dist/src/components/ui/login-screen/login-screen.d.cts +4 -0
  176. package/dist/src/components/ui/login-screen/login-screen.d.ts +2 -2
  177. package/dist/src/components/ui/login-screen/passkey-progress.d.cts +4 -0
  178. package/dist/src/components/ui/login-screen/passkey-progress.d.ts +2 -2
  179. package/dist/src/components/ui/login-screen/second-factor.d.cts +4 -0
  180. package/dist/src/components/ui/login-screen/second-factor.d.ts +2 -2
  181. package/dist/src/components/ui/login-screen/shared.d.cts +15 -0
  182. package/dist/src/components/ui/login-screen/shared.d.ts +2 -2
  183. package/dist/src/components/ui/login-screen/shell.d.cts +13 -0
  184. package/dist/src/components/ui/login-screen/shell.d.ts +1 -1
  185. package/dist/src/components/ui/login-screen/shell.d.ts.map +1 -1
  186. package/dist/src/components/ui/login-screen/status.d.cts +4 -0
  187. package/dist/src/components/ui/login-screen/status.d.ts +2 -2
  188. package/dist/src/components/ui/login-screen/types.d.cts +192 -0
  189. package/dist/src/components/ui/login-screen/types.d.ts +2 -2
  190. package/dist/src/components/ui/login-screen/types.d.ts.map +1 -1
  191. package/dist/src/components/ui/popover/index.d.cts +7 -0
  192. package/dist/src/components/ui/popover/index.d.ts +5 -5
  193. package/dist/src/components/ui/popover/index.d.ts.map +1 -1
  194. package/dist/src/components/ui/providers-box/index.d.cts +10 -0
  195. package/dist/src/components/ui/providers-box/index.d.ts +2 -2
  196. package/dist/src/components/ui/providers-box/index.d.ts.map +1 -1
  197. package/dist/src/components/ui/spinner/index.d.cts +23 -0
  198. package/dist/src/components/ui/spinner/index.d.ts +1 -1
  199. package/dist/src/components/ui/spinner/index.d.ts.map +1 -1
  200. package/dist/src/components/ui/switch/index.d.cts +22 -0
  201. package/dist/src/components/ui/switch/index.d.ts +1 -1
  202. package/dist/src/components/ui/switch/index.d.ts.map +1 -1
  203. package/dist/src/components/ui/upgrade-dialog/challenge.d.cts +12 -0
  204. package/dist/src/components/ui/upgrade-dialog/challenge.d.ts +2 -2
  205. package/dist/src/components/ui/upgrade-dialog/factor-list.d.cts +20 -0
  206. package/dist/src/components/ui/upgrade-dialog/factor-list.d.ts +2 -2
  207. package/dist/src/components/ui/upgrade-dialog/index.d.cts +8 -0
  208. package/dist/src/components/ui/upgrade-dialog/index.d.ts +7 -7
  209. package/dist/src/components/ui/upgrade-dialog/index.d.ts.map +1 -1
  210. package/dist/src/components/ui/upgrade-dialog/state-mapping.d.cts +130 -0
  211. package/dist/src/components/ui/upgrade-dialog/state-mapping.d.ts +12 -1
  212. package/dist/src/components/ui/upgrade-dialog/state-mapping.d.ts.map +1 -1
  213. package/dist/src/components/ui/upgrade-dialog/status.d.cts +27 -0
  214. package/dist/src/components/ui/upgrade-dialog/status.d.ts +2 -2
  215. package/dist/src/components/ui/upgrade-dialog/types.d.cts +188 -0
  216. package/dist/src/components/ui/upgrade-dialog/upgrade-dialog.d.cts +13 -0
  217. package/dist/src/components/ui/upgrade-dialog/upgrade-dialog.d.ts +2 -2
  218. package/dist/src/components/ui/visually-hidden/index.d.cts +17 -0
  219. package/dist/src/components/ui/visually-hidden/index.d.ts +17 -0
  220. package/dist/src/components/ui/visually-hidden/index.d.ts.map +1 -0
  221. package/dist/src/constants/countries-phone-code.d.cts +253 -0
  222. package/dist/src/constants/countries-phone-code.d.ts.map +1 -1
  223. package/dist/src/constants/formats.d.cts +4 -0
  224. package/dist/src/constants/formats.d.ts.map +1 -1
  225. package/dist/src/constants/index.d.cts +3 -0
  226. package/dist/src/constants/index.d.ts +2 -2
  227. package/dist/src/context/auth-context.d.cts +23 -0
  228. package/dist/src/context/auth-context.d.ts +3 -3
  229. package/dist/src/context/auth-context.d.ts.map +1 -1
  230. package/dist/src/context/index.d.cts +6 -0
  231. package/dist/src/context/index.d.ts +5 -5
  232. package/dist/src/context/index.d.ts.map +1 -1
  233. package/dist/src/context/navigation-context.d.cts +25 -0
  234. package/dist/src/context/navigation-context.d.ts +1 -1
  235. package/dist/src/context/passflow-context.d.cts +26 -0
  236. package/dist/src/context/passflow-context.d.ts +3 -3
  237. package/dist/src/context/passflow-context.d.ts.map +1 -1
  238. package/dist/src/context/router-context.d.cts +42 -0
  239. package/dist/src/context/router-context.d.ts.map +1 -1
  240. package/dist/src/context/upgrade-context.d.cts +107 -0
  241. package/dist/src/context/upgrade-context.d.ts +24 -2
  242. package/dist/src/hocs/index.d.cts +2 -0
  243. package/dist/src/hocs/index.d.ts +1 -1
  244. package/dist/src/hocs/with-error.d.cts +8 -0
  245. package/dist/src/hocs/with-error.d.ts +5 -5
  246. package/dist/src/hocs/with-error.d.ts.map +1 -1
  247. package/dist/src/hooks/index.d.cts +28 -0
  248. package/dist/src/hooks/index.d.ts +27 -27
  249. package/dist/src/hooks/index.d.ts.map +1 -1
  250. package/dist/src/hooks/use-app-settings.d.cts +16 -0
  251. package/dist/src/hooks/use-app-settings.d.ts +1 -1
  252. package/dist/src/hooks/use-app-settings.d.ts.map +1 -1
  253. package/dist/src/hooks/use-auth-cloud-redirect.d.cts +4 -0
  254. package/dist/src/hooks/use-auth.d.cts +3 -0
  255. package/dist/src/hooks/use-auth.d.ts +1 -1
  256. package/dist/src/hooks/use-auth.d.ts.map +1 -1
  257. package/dist/src/hooks/use-consent.d.cts +68 -0
  258. package/dist/src/hooks/use-device-verify.d.cts +96 -0
  259. package/dist/src/hooks/use-device-verify.d.ts +1 -1
  260. package/dist/src/hooks/use-device-verify.d.ts.map +1 -1
  261. package/dist/src/hooks/use-forgot-password.d.cts +10 -0
  262. package/dist/src/hooks/use-forgot-password.d.ts +1 -1
  263. package/dist/src/hooks/use-join-invite.d.cts +8 -0
  264. package/dist/src/hooks/use-logout.d.cts +8 -0
  265. package/dist/src/hooks/use-navigation.d.cts +29 -0
  266. package/dist/src/hooks/use-navigation.d.ts +2 -2
  267. package/dist/src/hooks/use-navigation.d.ts.map +1 -1
  268. package/dist/src/hooks/use-outsideclick.d.cts +3 -0
  269. package/dist/src/hooks/use-outsideclick.d.ts +2 -2
  270. package/dist/src/hooks/use-outsideclick.d.ts.map +1 -1
  271. package/dist/src/hooks/use-passflow-store.d.cts +3 -0
  272. package/dist/src/hooks/use-passflow-store.d.ts +1 -1
  273. package/dist/src/hooks/use-passflow.d.cts +3 -0
  274. package/dist/src/hooks/use-passflow.d.ts +1 -1
  275. package/dist/src/hooks/use-passflow.d.ts.map +1 -1
  276. package/dist/src/hooks/use-passwordless-complete.d.cts +10 -0
  277. package/dist/src/hooks/use-passwordless-complete.d.ts +1 -1
  278. package/dist/src/hooks/use-passwordless-complete.d.ts.map +1 -1
  279. package/dist/src/hooks/use-provider.d.cts +7 -0
  280. package/dist/src/hooks/use-provider.d.ts +1 -1
  281. package/dist/src/hooks/use-provider.d.ts.map +1 -1
  282. package/dist/src/hooks/use-reset-password.d.cts +9 -0
  283. package/dist/src/hooks/use-session-expired.d.cts +49 -0
  284. package/dist/src/hooks/use-signin.d.cts +11 -0
  285. package/dist/src/hooks/use-signin.d.ts +2 -2
  286. package/dist/src/hooks/use-signin.d.ts.map +1 -1
  287. package/dist/src/hooks/use-signup.d.cts +11 -0
  288. package/dist/src/hooks/use-signup.d.ts +2 -2
  289. package/dist/src/hooks/use-signup.d.ts.map +1 -1
  290. package/dist/src/hooks/use-trusted-devices.d.cts +21 -0
  291. package/dist/src/hooks/use-trusted-devices.d.ts +1 -1
  292. package/dist/src/hooks/use-two-factor-challenge.d.cts +16 -0
  293. package/dist/src/hooks/use-two-factor-challenge.d.ts +1 -1
  294. package/dist/src/hooks/use-two-factor-manage.d.cts +15 -0
  295. package/dist/src/hooks/use-two-factor-manage.d.ts +1 -1
  296. package/dist/src/hooks/use-two-factor-methods.d.cts +14 -0
  297. package/dist/src/hooks/use-two-factor-methods.d.ts +1 -1
  298. package/dist/src/hooks/use-two-factor-setup-magic-link.d.cts +55 -0
  299. package/dist/src/hooks/use-two-factor-setup-magic-link.d.ts.map +1 -1
  300. package/dist/src/hooks/use-two-factor-setup.d.cts +18 -0
  301. package/dist/src/hooks/use-two-factor-setup.d.ts +1 -1
  302. package/dist/src/hooks/use-two-factor-status.d.cts +13 -0
  303. package/dist/src/hooks/use-two-factor-status.d.ts +1 -1
  304. package/dist/src/hooks/use-two-factor-verify.d.cts +20 -0
  305. package/dist/src/hooks/use-two-factor-verify.d.ts +2 -2
  306. package/dist/src/hooks/use-two-factor-verify.d.ts.map +1 -1
  307. package/dist/src/hooks/use-upgrade.d.cts +53 -0
  308. package/dist/src/hooks/use-upgrade.d.ts +12 -2
  309. package/dist/src/hooks/use-upgrade.d.ts.map +1 -1
  310. package/dist/src/hooks/use-user-passkeys.d.cts +12 -0
  311. package/dist/src/hooks/use-user-passkeys.d.ts +1 -1
  312. package/dist/src/index.d.cts +10 -0
  313. package/dist/src/index.d.ts +8 -8
  314. package/dist/src/index.d.ts.map +1 -1
  315. package/dist/src/types/auth-errors.d.cts +8 -0
  316. package/dist/src/types/device-errors.d.cts +95 -0
  317. package/dist/src/types/index.d.cts +26 -0
  318. package/dist/src/types/index.d.ts +4 -4
  319. package/dist/src/types/index.d.ts.map +1 -1
  320. package/dist/src/types/two-factor-errors.d.cts +14 -0
  321. package/dist/src/utils/auth-error.d.cts +7 -0
  322. package/dist/src/utils/auth-error.d.ts +1 -1
  323. package/dist/src/utils/auth-error.d.ts.map +1 -1
  324. package/dist/src/utils/classify-device-error.d.cts +35 -0
  325. package/dist/src/utils/classify-device-error.d.ts +1 -1
  326. package/dist/src/utils/classify-device-error.d.ts.map +1 -1
  327. package/dist/src/utils/classify-two-factor-error.d.cts +13 -0
  328. package/dist/src/utils/classify-two-factor-error.d.ts +1 -1
  329. package/dist/src/utils/cn.d.cts +3 -0
  330. package/dist/src/utils/cn.d.ts +1 -1
  331. package/dist/src/utils/cn.d.ts.map +1 -1
  332. package/dist/src/utils/dayjs/format.d.cts +8 -0
  333. package/dist/src/utils/dayjs/format.d.ts.map +1 -1
  334. package/dist/src/utils/dayjs/index.d.cts +2 -0
  335. package/dist/src/utils/dayjs/index.d.ts +1 -1
  336. package/dist/src/utils/get-app-version.d.cts +7 -0
  337. package/dist/src/utils/get-auth-methods.d.cts +30 -0
  338. package/dist/src/utils/get-auth-methods.d.ts +1 -1
  339. package/dist/src/utils/get-auth-methods.d.ts.map +1 -1
  340. package/dist/src/utils/get-form-labels.d.cts +10 -0
  341. package/dist/src/utils/get-form-labels.d.ts +5 -5
  342. package/dist/src/utils/get-form-labels.d.ts.map +1 -1
  343. package/dist/src/utils/get-url-errors.d.cts +5 -0
  344. package/dist/src/utils/get-url-errors.d.ts.map +1 -1
  345. package/dist/src/utils/get-url-with-tokens.d.cts +4 -0
  346. package/dist/src/utils/get-url-with-tokens.d.ts +1 -1
  347. package/dist/src/utils/get-url-with-tokens.d.ts.map +1 -1
  348. package/dist/src/utils/index.d.cts +18 -0
  349. package/dist/src/utils/index.d.ts +17 -17
  350. package/dist/src/utils/index.d.ts.map +1 -1
  351. package/dist/src/utils/invitation-auth-chrome.d.cts +8 -0
  352. package/dist/src/utils/invitation-auth-chrome.d.ts.map +1 -1
  353. package/dist/src/utils/login-theme.d.cts +8 -0
  354. package/dist/src/utils/login-theme.d.ts +1 -1
  355. package/dist/src/utils/login-theme.d.ts.map +1 -1
  356. package/dist/src/utils/second-factor.d.cts +21 -0
  357. package/dist/src/utils/second-factor.d.ts +3 -3
  358. package/dist/src/utils/second-factor.d.ts.map +1 -1
  359. package/dist/src/utils/two-factor-loop-prevention.d.cts +40 -0
  360. package/dist/src/utils/two-factor-loop-prevention.d.ts.map +1 -1
  361. package/dist/src/utils/undefined-on-catch.d.cts +2 -0
  362. package/dist/src/utils/upgrade-auth.d.cts +82 -0
  363. package/dist/src/utils/upgrade-auth.d.ts +45 -1
  364. package/dist/src/utils/upgrade-auth.d.ts.map +1 -1
  365. package/dist/src/utils/url-params.d.cts +14 -0
  366. package/dist/src/utils/url-params.d.ts.map +1 -1
  367. package/dist/src/utils/validate-url.d.cts +2 -0
  368. package/dist/src/utils/validate-url.d.ts.map +1 -1
  369. package/dist/src/utils/validation-schemas/index.d.cts +6 -0
  370. package/dist/src/utils/validation-schemas/index.d.ts +1 -1
  371. package/dist/src/utils/validation-schemas/index.d.ts.map +1 -1
  372. package/dist/style.css +1 -1
  373. package/package.json +54 -56
  374. package/dist/index.cjs.js +0 -2
  375. package/dist/index.cjs.js.map +0 -1
  376. package/dist/src/components/form/two-factor-challenge/otp-input.d.ts +0 -12
  377. package/dist/src/components/form/two-factor-challenge/otp-input.d.ts.map +0 -1
@@ -21,5 +21,5 @@ export type NavigationContextType = {
21
21
  setTwoFactorVerifyPath?: (path: string | null) => void;
22
22
  };
23
23
  export declare const defaultNavigate: NavigateFunction;
24
- export declare const NavigationContext: import('react').Context<NavigationContextType>;
24
+ export declare const NavigationContext: import("react").Context<NavigationContextType>;
25
25
  //# sourceMappingURL=navigation-context.d.ts.map
@@ -0,0 +1,26 @@
1
+ import type { AppSettings, Passflow, PassflowPasswordPolicySettings } from '@passflow/core';
2
+ import { type Dispatch } from 'react';
3
+ export type PassflowState = {
4
+ appSettings: AppSettings | null;
5
+ passwordPolicy: PassflowPasswordPolicySettings | null;
6
+ url?: string;
7
+ appId?: string;
8
+ scopes?: string[];
9
+ createTenantForNewUser?: boolean;
10
+ parseQueryParams?: boolean;
11
+ isDiscoveringAppId?: boolean;
12
+ hasSettingsError?: boolean;
13
+ };
14
+ export type PassflowAction = {
15
+ type: 'SET_PASSFLOW_STATE';
16
+ payload: PassflowState;
17
+ };
18
+ export type PassflowContextType = {
19
+ state: PassflowState;
20
+ dispatch: Dispatch<PassflowAction>;
21
+ passflow: Passflow;
22
+ };
23
+ export declare const initialState: PassflowState;
24
+ export declare const PassflowContext: import("react").Context<PassflowContextType | undefined>;
25
+ export declare const passflowReducer: (state: PassflowState, action: PassflowAction) => PassflowState;
26
+ //# sourceMappingURL=passflow-context.d.ts.map
@@ -1,5 +1,5 @@
1
- import { AppSettings, Passflow, PassflowPasswordPolicySettings } from '@passflow/core';
2
- import { Dispatch } from 'react';
1
+ import type { AppSettings, Passflow, PassflowPasswordPolicySettings } from '@passflow/core';
2
+ import { type Dispatch } from 'react';
3
3
  export type PassflowState = {
4
4
  appSettings: AppSettings | null;
5
5
  passwordPolicy: PassflowPasswordPolicySettings | null;
@@ -21,6 +21,6 @@ export type PassflowContextType = {
21
21
  passflow: Passflow;
22
22
  };
23
23
  export declare const initialState: PassflowState;
24
- export declare const PassflowContext: import('react').Context<PassflowContextType | undefined>;
24
+ export declare const PassflowContext: import("react").Context<PassflowContextType | undefined>;
25
25
  export declare const passflowReducer: (state: PassflowState, action: PassflowAction) => PassflowState;
26
26
  //# sourceMappingURL=passflow-context.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"passflow-context.d.ts","sourceRoot":"","sources":["../../../src/context/passflow-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,8BAA8B,EAAE,MAAM,gBAAgB,CAAC;AAC5F,OAAO,EAAE,KAAK,QAAQ,EAAiB,MAAM,OAAO,CAAC;AAErD,MAAM,MAAM,aAAa,GAAG;IAC1B,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;IAChC,cAAc,EAAE,8BAA8B,GAAG,IAAI,CAAC;IACtD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAAE,IAAI,EAAE,oBAAoB,CAAC;IAAC,OAAO,EAAE,aAAa,CAAA;CAAE,CAAC;AAEpF,MAAM,MAAM,mBAAmB,GAAG;IAChC,KAAK,EAAE,aAAa,CAAC;IACrB,QAAQ,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC;IACnC,QAAQ,EAAE,QAAQ,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,aAU1B,CAAC;AAEF,eAAO,MAAM,eAAe,0DAA4D,CAAC;AAEzF,eAAO,MAAM,eAAe,GAAI,OAAO,aAAa,EAAE,QAAQ,cAAc,KAAG,aAO9E,CAAC"}
1
+ {"version":3,"file":"passflow-context.d.ts","sourceRoot":"","sources":["../../../src/context/passflow-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,8BAA8B,EAAE,MAAM,gBAAgB,CAAC;AAC5F,OAAO,EAAiB,KAAK,QAAQ,EAAE,MAAM,OAAO,CAAC;AAErD,MAAM,MAAM,aAAa,GAAG;IAC1B,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;IAChC,cAAc,EAAE,8BAA8B,GAAG,IAAI,CAAC;IACtD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAAE,IAAI,EAAE,oBAAoB,CAAC;IAAC,OAAO,EAAE,aAAa,CAAA;CAAE,CAAC;AAEpF,MAAM,MAAM,mBAAmB,GAAG;IAChC,KAAK,EAAE,aAAa,CAAC;IACrB,QAAQ,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC;IACnC,QAAQ,EAAE,QAAQ,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,aAU1B,CAAC;AAEF,eAAO,MAAM,eAAe,0DAA4D,CAAC;AAEzF,eAAO,MAAM,eAAe,UAAW,aAAa,UAAU,cAAc,KAAG,aAO9E,CAAC"}
@@ -0,0 +1,42 @@
1
+ export declare const routes: {
2
+ signin: {
3
+ path: string;
4
+ };
5
+ signup: {
6
+ path: string;
7
+ };
8
+ verify_otp: {
9
+ path: string;
10
+ };
11
+ verify_magic_link: {
12
+ path: string;
13
+ };
14
+ forgot_password: {
15
+ path: string;
16
+ };
17
+ forgot_password_success: {
18
+ path: string;
19
+ };
20
+ reset_password: {
21
+ path: string;
22
+ };
23
+ invitation: {
24
+ path: string;
25
+ };
26
+ passkey: {
27
+ path: string;
28
+ };
29
+ two_factor_verify: {
30
+ path: string;
31
+ };
32
+ two_factor_recovery: {
33
+ path: string;
34
+ };
35
+ two_factor_setup: {
36
+ path: string;
37
+ };
38
+ two_factor_setup_magic_link: {
39
+ path: string;
40
+ };
41
+ };
42
+ //# sourceMappingURL=router-context.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"router-context.d.ts","sourceRoot":"","sources":["../../../src/context/router-context.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwClB,CAAC"}
1
+ {"version":3,"file":"router-context.d.ts","sourceRoot":"","sources":["../../../src/context/router-context.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;IACjB,MAAM;QACJ,IAAI;;IAEN,MAAM;QACJ,IAAI;;IAEN,UAAU;QACR,IAAI;;IAEN,iBAAiB;QACf,IAAI;;IAEN,eAAe;QACb,IAAI;;IAEN,uBAAuB;QACrB,IAAI;;IAEN,cAAc;QACZ,IAAI;;IAEN,UAAU;QACR,IAAI;;IAEN,OAAO;QACL,IAAI;;IAEN,iBAAiB;QACf,IAAI;;IAEN,mBAAmB;QACjB,IAAI;;IAEN,gBAAgB;QACd,IAAI;;IAEN,2BAA2B;QACzB,IAAI;;CAEP,CAAC"}
@@ -0,0 +1,107 @@
1
+ /**
2
+ * The assurance-upgrade context — the one channel between `UpgradeProvider`
3
+ * and `useUpgrade` (architecture §8.2, §13.3).
4
+ *
5
+ * The provider owns the controller, the prompt handler and every transition;
6
+ * this module owns only the shape they are read through. Two hooks each
7
+ * installing a prompt handler would produce two prompts and defeat
8
+ * single-flight, so nothing here installs anything.
9
+ *
10
+ * `status` is §13.5's `UpgradeHookState`, which is §13.3's settlement table
11
+ * read down the hook column. Two consequences the types enforce:
12
+ *
13
+ * - **`insufficient` is a first-class state, not an error and not a success.**
14
+ * "Elevated to AAL2; this action requires AAL3" is the normal path for an
15
+ * AAL3 endpoint and a TOTP-only user, and a design cannot both claim the
16
+ * server is the authority and delete the path by which its second refusal
17
+ * reaches the user.
18
+ * - **Cancellation is not a status.** It is `elevate()` resolving `null`. The
19
+ * hook is the one surface where that is right, because there the
20
+ * cancellation IS the whole value: the consumer is rendering a decision, not
21
+ * handling a transport outcome.
22
+ */
23
+ import type { AssuranceBar, UpgradeChallenge, UpgradeFactor, UpgradeFactorType } from '@passflow/core';
24
+ /** What a protected elevation can fail with, in the hook's vocabulary (§13.3's table). */
25
+ export type UpgradeErrorStatusKind = 'exhausted' | 'unsatisfiable' | 'unavailable' | 'transport';
26
+ /**
27
+ * The hook's observable state. Exactly one terminal state per flight, taken
28
+ * from the controller's outcome summary (§13.4).
29
+ *
30
+ * `idle` is also where a flight abandoned by a session change lands: nothing
31
+ * happened, and nothing is reported as though it had.
32
+ */
33
+ export type UpgradeHookState = {
34
+ status: 'idle';
35
+ } | {
36
+ status: 'challenged';
37
+ challenge: UpgradeChallenge;
38
+ factors: UpgradeFactorType[];
39
+ } | {
40
+ status: 'submitting';
41
+ } | {
42
+ status: 'success';
43
+ } | {
44
+ status: 'insufficient';
45
+ obtained: AssuranceBar;
46
+ required: AssuranceBar;
47
+ } | {
48
+ status: 'error';
49
+ kind: UpgradeErrorStatusKind;
50
+ error: Error;
51
+ };
52
+ /** The states a flight can settle in. `null` alongside these is cancellation. */
53
+ export type UpgradeSettledState = Extract<UpgradeHookState, {
54
+ status: 'idle' | 'success' | 'insufficient' | 'error';
55
+ }>;
56
+ /** A bar a caller states for itself on the imperative seam (§13.2 T10 / H-6). */
57
+ export type UpgradeElevateOptions = {
58
+ acrValues?: string;
59
+ maxAge?: number;
60
+ };
61
+ /** The open prompt, as the dialog and the hook read it. */
62
+ export type UpgradePromptView = {
63
+ challenge: UpgradeChallenge;
64
+ /** Already ranked by `selectFactors`; index 0 is the suggested factor. */
65
+ factors: readonly UpgradeFactor[];
66
+ /** The previous attempt's failure, when the controller re-prompted. */
67
+ previousError?: Error;
68
+ };
69
+ export type UpgradeContextValue = {
70
+ /** True when the provider installed a prompt handler on this `Passflow` instance. */
71
+ enabled: boolean;
72
+ state: UpgradeHookState;
73
+ /** The open prompt, or `null` when no elevation is collecting an answer. */
74
+ prompt: UpgradePromptView | null;
75
+ selectedFactor: UpgradeFactorType | null;
76
+ /**
77
+ * The factor-selection signal. Reports the user's choice to the controller
78
+ * through `UpgradePromptRequest.onFactorSelected` the moment it is made and
79
+ * before any answer is submitted — §13.2's late-join boundary (T3), which is
80
+ * selection and not submission.
81
+ */
82
+ selectFactor: (factor: UpgradeFactorType) => void;
83
+ /** Answers the open prompt. Resolves the controller's promise exactly once. */
84
+ submit: (code?: string) => void;
85
+ /** Declines the open prompt. Exactly once; never leaves the promise pending. */
86
+ cancel: () => void;
87
+ /** Acknowledges a terminal state, closing the dialog. Settles nothing. */
88
+ dismiss: () => void;
89
+ /**
90
+ * Drives an elevation directly — a "verify now" button, or a headless
91
+ * caller. Resolves **`null`** when the user cancelled, and otherwise the
92
+ * flight's terminal state; it never rejects, because the hook's contract is
93
+ * a rendered decision rather than a thrown transport outcome.
94
+ */
95
+ elevate: (options?: UpgradeElevateOptions) => Promise<UpgradeSettledState | null>;
96
+ };
97
+ export declare const UpgradeContext: import("react").Context<UpgradeContextValue | undefined>;
98
+ /**
99
+ * What `useUpgrade` reads outside an `UpgradeProvider`: idle, inert, and it
100
+ * does not throw (§9.5 H8) — a component that merely wants to know whether an
101
+ * elevation is running is not a bug.
102
+ *
103
+ * `elevate` resolves `{ status: 'idle' }` rather than `null`: nothing was
104
+ * asked and nothing was declined, and `null` means the user declined.
105
+ */
106
+ export declare const INERT_UPGRADE_CONTEXT: UpgradeContextValue;
107
+ //# sourceMappingURL=upgrade-context.d.ts.map
@@ -1,4 +1,26 @@
1
- import { AssuranceBar, UpgradeChallenge, UpgradeFactor, UpgradeFactorType } from '@passflow/core';
1
+ /**
2
+ * The assurance-upgrade context — the one channel between `UpgradeProvider`
3
+ * and `useUpgrade` (architecture §8.2, §13.3).
4
+ *
5
+ * The provider owns the controller, the prompt handler and every transition;
6
+ * this module owns only the shape they are read through. Two hooks each
7
+ * installing a prompt handler would produce two prompts and defeat
8
+ * single-flight, so nothing here installs anything.
9
+ *
10
+ * `status` is §13.5's `UpgradeHookState`, which is §13.3's settlement table
11
+ * read down the hook column. Two consequences the types enforce:
12
+ *
13
+ * - **`insufficient` is a first-class state, not an error and not a success.**
14
+ * "Elevated to AAL2; this action requires AAL3" is the normal path for an
15
+ * AAL3 endpoint and a TOTP-only user, and a design cannot both claim the
16
+ * server is the authority and delete the path by which its second refusal
17
+ * reaches the user.
18
+ * - **Cancellation is not a status.** It is `elevate()` resolving `null`. The
19
+ * hook is the one surface where that is right, because there the
20
+ * cancellation IS the whole value: the consumer is rendering a decision, not
21
+ * handling a transport outcome.
22
+ */
23
+ import type { AssuranceBar, UpgradeChallenge, UpgradeFactor, UpgradeFactorType } from '@passflow/core';
2
24
  /** What a protected elevation can fail with, in the hook's vocabulary (§13.3's table). */
3
25
  export type UpgradeErrorStatusKind = 'exhausted' | 'unsatisfiable' | 'unavailable' | 'transport';
4
26
  /**
@@ -72,7 +94,7 @@ export type UpgradeContextValue = {
72
94
  */
73
95
  elevate: (options?: UpgradeElevateOptions) => Promise<UpgradeSettledState | null>;
74
96
  };
75
- export declare const UpgradeContext: import('react').Context<UpgradeContextValue | undefined>;
97
+ export declare const UpgradeContext: import("react").Context<UpgradeContextValue | undefined>;
76
98
  /**
77
99
  * What `useUpgrade` reads outside an `UpgradeProvider`: idle, inert, and it
78
100
  * does not throw (§9.5 H8) — a component that merely wants to know whether an
@@ -0,0 +1,2 @@
1
+ export { withError } from './with-error.cjs';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1,2 @@
1
- export { withError } from './with-error';
1
+ export { withError } from './with-error.js';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,8 @@
1
+ import { type ComponentType } from 'react';
2
+ import type { TError } from '../components/error/index.cjs';
3
+ import type { PassflowProps } from '../components/flow/passflow/index.cjs';
4
+ import type { TInvitationJoinFlow, TSignIn, TSignUp } from '../components/form/index.cjs';
5
+ type UnionType = TSignIn | TSignUp | TInvitationJoinFlow | PassflowProps;
6
+ export declare const withError: <P extends UnionType>(Component: ComponentType<P>, ErrorComponent: ComponentType<TError>) => (props: P) => import("react").JSX.Element | null;
7
+ export default withError;
8
+ //# sourceMappingURL=with-error.d.ts.map
@@ -1,8 +1,8 @@
1
- import { TError } from '../components/error';
2
- import { PassflowProps } from '../components/flow/passflow';
3
- import { TInvitationJoinFlow, TSignIn, TSignUp } from '../components/form';
4
- import { default as React, ComponentType } from 'react';
1
+ import { type ComponentType } from 'react';
2
+ import type { TError } from '../components/error/index.js';
3
+ import type { PassflowProps } from '../components/flow/passflow/index.js';
4
+ import type { TInvitationJoinFlow, TSignIn, TSignUp } from '../components/form/index.js';
5
5
  type UnionType = TSignIn | TSignUp | TInvitationJoinFlow | PassflowProps;
6
- export declare const withError: <P extends UnionType>(Component: ComponentType<P>, ErrorComponent: ComponentType<TError>) => (props: P) => React.JSX.Element | null;
6
+ export declare const withError: <P extends UnionType>(Component: ComponentType<P>, ErrorComponent: ComponentType<TError>) => (props: P) => import("react").JSX.Element | null;
7
7
  export default withError;
8
8
  //# sourceMappingURL=with-error.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"with-error.d.ts","sourceRoot":"","sources":["../../../src/hocs/with-error.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,EAAE,mBAAmB,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE/E,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,KAAK,aAAa,EAAc,MAAM,OAAO,CAAC;AAGvD,KAAK,SAAS,GAAG,OAAO,GAAG,OAAO,GAAG,mBAAmB,GAAG,aAAa,CAAC;AAQzE,eAAO,MAAM,SAAS,GACnB,CAAC,SAAS,SAAS,EAAE,WAAW,aAAa,CAAC,CAAC,CAAC,EAAE,gBAAgB,aAAa,CAAC,MAAM,CAAC,MACvF,OAAO,CAAC,6BAyCR,CAAC;AAEJ,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"with-error.d.ts","sourceRoot":"","sources":["../../../src/hocs/with-error.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAc,MAAM,OAAO,CAAC;AAEvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,EAAE,mBAAmB,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAG/E,KAAK,SAAS,GAAG,OAAO,GAAG,OAAO,GAAG,mBAAmB,GAAG,aAAa,CAAC;AAMzE,eAAO,MAAM,SAAS,GACnB,CAAC,SAAS,SAAS,aAAa,aAAa,CAAC,CAAC,CAAC,kBAAkB,aAAa,CAAC,MAAM,CAAC,aAChF,CAAC,uCAyCR,CAAC;eAEW,SAAS"}
@@ -0,0 +1,28 @@
1
+ export { type UseAppSettingsProps, useAppSettings } from './use-app-settings.cjs';
2
+ export { useAuth } from './use-auth.cjs';
3
+ export { useAuthCloudRedirect } from './use-auth-cloud-redirect.cjs';
4
+ export { type ConsentError, type ConsentInfo, type ConsentScopeMetadata, type ConsentStatus, type UseConsentProps, useConsent, } from './use-consent.cjs';
5
+ export { type DeviceUIMode, type DeviceVerifyInfo, type DeviceVerifyStatus, type UseDeviceVerifyProps, useDeviceVerify, } from './use-device-verify.cjs';
6
+ export { type UseForgotPasswordProps, useForgotPassword } from './use-forgot-password.cjs';
7
+ export { useJoinInvite } from './use-join-invite.cjs';
8
+ export { type UseLogoutProps, useLogout } from './use-logout.cjs';
9
+ export { useNavigation } from './use-navigation.cjs';
10
+ export { useOutsideClick } from './use-outsideclick.cjs';
11
+ export { usePassflow } from './use-passflow.cjs';
12
+ export { type UsePasswordlessCompleteProps, usePasswordlessComplete } from './use-passwordless-complete.cjs';
13
+ export { type UseProviderProps, useProvider } from './use-provider.cjs';
14
+ export { type UseResetPasswordProps, useResetPassword } from './use-reset-password.cjs';
15
+ export { type SessionExpiredReason, type UseSessionExpiredOptions, type UseSessionExpiredResult, useSessionExpired, } from './use-session-expired.cjs';
16
+ export { type UseSignInProps, useSignIn } from './use-signin.cjs';
17
+ export { type UseSignUpProps, useSignUp } from './use-signup.cjs';
18
+ export { type UseTrustedDevicesProps, useTrustedDevices } from './use-trusted-devices.cjs';
19
+ export { type UseTwoFactorChallengeReturn, useTwoFactorChallenge } from './use-two-factor-challenge.cjs';
20
+ export { type UseTwoFactorManageProps, useTwoFactorManage } from './use-two-factor-manage.cjs';
21
+ export { type UseTwoFactorMethodsReturn, useTwoFactorMethods } from './use-two-factor-methods.cjs';
22
+ export { type TwoFactorSetupStep, type UseTwoFactorSetupProps, useTwoFactorSetup } from './use-two-factor-setup.cjs';
23
+ export { type UseTwoFactorSetupMagicLinkReturn, useTwoFactorSetupMagicLink } from './use-two-factor-setup-magic-link.cjs';
24
+ export { type UseTwoFactorStatusProps, useTwoFactorStatus } from './use-two-factor-status.cjs';
25
+ export { type UseTwoFactorVerifyProps, useTwoFactorVerify } from './use-two-factor-verify.cjs';
26
+ export { type UseUpgradeResult, useUpgrade } from './use-upgrade.cjs';
27
+ export { type UseUserPasskeysProps, useUserPasskeys } from './use-user-passkeys.cjs';
28
+ //# sourceMappingURL=index.d.ts.map
@@ -1,28 +1,28 @@
1
- export { useSignIn, type UseSignInProps } from './use-signin';
2
- export { useProvider, type UseProviderProps } from './use-provider';
3
- export { useSignUp, type UseSignUpProps } from './use-signup';
4
- export { useForgotPassword, type UseForgotPasswordProps } from './use-forgot-password';
5
- export { useResetPassword, type UseResetPasswordProps } from './use-reset-password';
6
- export { useAppSettings, type UseAppSettingsProps } from './use-app-settings';
7
- export { usePassflow } from './use-passflow';
8
- export { usePasswordlessComplete, type UsePasswordlessCompleteProps } from './use-passwordless-complete';
9
- export { useAuth } from './use-auth';
10
- export { useLogout, type UseLogoutProps } from './use-logout';
11
- export { useUserPasskeys, type UseUserPasskeysProps } from './use-user-passkeys';
12
- export { useAuthCloudRedirect } from './use-auth-cloud-redirect';
13
- export { useJoinInvite } from './use-join-invite';
14
- export { useOutsideClick } from './use-outsideclick';
15
- export { useNavigation } from './use-navigation';
16
- export { useTwoFactorStatus, type UseTwoFactorStatusProps } from './use-two-factor-status';
17
- export { useTwoFactorSetup, type UseTwoFactorSetupProps, type TwoFactorSetupStep } from './use-two-factor-setup';
18
- export { useTwoFactorVerify, type UseTwoFactorVerifyProps } from './use-two-factor-verify';
19
- export { useTwoFactorManage, type UseTwoFactorManageProps } from './use-two-factor-manage';
20
- export { useTwoFactorSetupMagicLink, type UseTwoFactorSetupMagicLinkReturn } from './use-two-factor-setup-magic-link';
21
- export { useTwoFactorChallenge, type UseTwoFactorChallengeReturn } from './use-two-factor-challenge';
22
- export { useTwoFactorMethods, type UseTwoFactorMethodsReturn } from './use-two-factor-methods';
23
- export { useTrustedDevices, type UseTrustedDevicesProps } from './use-trusted-devices';
24
- export { useSessionExpired, type UseSessionExpiredOptions, type UseSessionExpiredResult, type SessionExpiredReason, } from './use-session-expired';
25
- export { useDeviceVerify, type UseDeviceVerifyProps, type DeviceVerifyStatus, type DeviceVerifyInfo, type DeviceUIMode, } from './use-device-verify';
26
- export { useConsent, type UseConsentProps, type ConsentStatus, type ConsentInfo, type ConsentError, type ConsentScopeMetadata, } from './use-consent';
27
- export { useUpgrade, type UseUpgradeResult } from './use-upgrade';
1
+ export { type UseAppSettingsProps, useAppSettings } from './use-app-settings.js';
2
+ export { useAuth } from './use-auth.js';
3
+ export { useAuthCloudRedirect } from './use-auth-cloud-redirect.js';
4
+ export { type ConsentError, type ConsentInfo, type ConsentScopeMetadata, type ConsentStatus, type UseConsentProps, useConsent, } from './use-consent.js';
5
+ export { type DeviceUIMode, type DeviceVerifyInfo, type DeviceVerifyStatus, type UseDeviceVerifyProps, useDeviceVerify, } from './use-device-verify.js';
6
+ export { type UseForgotPasswordProps, useForgotPassword } from './use-forgot-password.js';
7
+ export { useJoinInvite } from './use-join-invite.js';
8
+ export { type UseLogoutProps, useLogout } from './use-logout.js';
9
+ export { useNavigation } from './use-navigation.js';
10
+ export { useOutsideClick } from './use-outsideclick.js';
11
+ export { usePassflow } from './use-passflow.js';
12
+ export { type UsePasswordlessCompleteProps, usePasswordlessComplete } from './use-passwordless-complete.js';
13
+ export { type UseProviderProps, useProvider } from './use-provider.js';
14
+ export { type UseResetPasswordProps, useResetPassword } from './use-reset-password.js';
15
+ export { type SessionExpiredReason, type UseSessionExpiredOptions, type UseSessionExpiredResult, useSessionExpired, } from './use-session-expired.js';
16
+ export { type UseSignInProps, useSignIn } from './use-signin.js';
17
+ export { type UseSignUpProps, useSignUp } from './use-signup.js';
18
+ export { type UseTrustedDevicesProps, useTrustedDevices } from './use-trusted-devices.js';
19
+ export { type UseTwoFactorChallengeReturn, useTwoFactorChallenge } from './use-two-factor-challenge.js';
20
+ export { type UseTwoFactorManageProps, useTwoFactorManage } from './use-two-factor-manage.js';
21
+ export { type UseTwoFactorMethodsReturn, useTwoFactorMethods } from './use-two-factor-methods.js';
22
+ export { type TwoFactorSetupStep, type UseTwoFactorSetupProps, useTwoFactorSetup } from './use-two-factor-setup.js';
23
+ export { type UseTwoFactorSetupMagicLinkReturn, useTwoFactorSetupMagicLink } from './use-two-factor-setup-magic-link.js';
24
+ export { type UseTwoFactorStatusProps, useTwoFactorStatus } from './use-two-factor-status.js';
25
+ export { type UseTwoFactorVerifyProps, useTwoFactorVerify } from './use-two-factor-verify.js';
26
+ export { type UseUpgradeResult, useUpgrade } from './use-upgrade.js';
27
+ export { type UseUserPasskeysProps, useUserPasskeys } from './use-user-passkeys.js';
28
28
  //# 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,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,KAAK,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACvF,OAAO,EAAE,gBAAgB,EAAE,KAAK,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AACpF,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,uBAAuB,EAAE,KAAK,4BAA4B,EAAE,MAAM,6BAA6B,CAAC;AACzG,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,kBAAkB,EAAE,KAAK,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAC3F,OAAO,EAAE,iBAAiB,EAAE,KAAK,sBAAsB,EAAE,KAAK,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACjH,OAAO,EAAE,kBAAkB,EAAE,KAAK,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAC3F,OAAO,EAAE,kBAAkB,EAAE,KAAK,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAC3F,OAAO,EAAE,0BAA0B,EAAE,KAAK,gCAAgC,EAAE,MAAM,mCAAmC,CAAC;AACtH,OAAO,EAAE,qBAAqB,EAAE,KAAK,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACrG,OAAO,EAAE,mBAAmB,EAAE,KAAK,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAC/F,OAAO,EAAE,iBAAiB,EAAE,KAAK,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAEvF,OAAO,EACL,iBAAiB,EACjB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,GAC1B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,eAAe,EACf,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,YAAY,GAClB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,UAAU,EACV,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,oBAAoB,GAC1B,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,mBAAmB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,UAAU,GACX,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,eAAe,GAChB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AACvF,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,KAAK,cAAc,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,KAAK,4BAA4B,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACzG,OAAO,EAAE,KAAK,gBAAgB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,KAAK,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAEpF,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,KAAK,cAAc,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,KAAK,cAAc,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,KAAK,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AACvF,OAAO,EAAE,KAAK,2BAA2B,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACrG,OAAO,EAAE,KAAK,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC3F,OAAO,EAAE,KAAK,yBAAyB,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/F,OAAO,EAAE,KAAK,kBAAkB,EAAE,KAAK,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AACjH,OAAO,EAAE,KAAK,gCAAgC,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAEtH,OAAO,EAAE,KAAK,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC3F,OAAO,EAAE,KAAK,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE3F,OAAO,EAAE,KAAK,gBAAgB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,KAAK,oBAAoB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { AppSettings, LoginWebAppStyle, LoginWebAppTheme, PassflowPasswordPolicySettings } from '@passflow/core';
2
+ export type UseAppSettingsProps = () => {
3
+ appSettings: AppSettings | null;
4
+ passwordPolicy: PassflowPasswordPolicySettings | null;
5
+ isLoading: boolean;
6
+ isError: boolean;
7
+ error: string;
8
+ reset: () => void;
9
+ currentTheme: string;
10
+ currentStyles: LoginWebAppStyle | null;
11
+ scopes: string[];
12
+ createTenantForNewUser: boolean;
13
+ loginAppTheme?: LoginWebAppTheme;
14
+ };
15
+ export declare const useAppSettings: UseAppSettingsProps;
16
+ //# sourceMappingURL=use-app-settings.d.ts.map
@@ -1,4 +1,4 @@
1
- import { AppSettings, LoginWebAppStyle, LoginWebAppTheme, PassflowPasswordPolicySettings } from '@passflow/core';
1
+ import type { AppSettings, LoginWebAppStyle, LoginWebAppTheme, PassflowPasswordPolicySettings } from '@passflow/core';
2
2
  export type UseAppSettingsProps = () => {
3
3
  appSettings: AppSettings | null;
4
4
  passwordPolicy: PassflowPasswordPolicySettings | null;
@@ -1 +1 @@
1
- {"version":3,"file":"use-app-settings.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-app-settings.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,8BAA8B,EAAE,MAAM,gBAAgB,CAAC;AAKtH,MAAM,MAAM,mBAAmB,GAAG,MAAM;IACtC,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;IAChC,cAAc,EAAE,8BAA8B,GAAG,IAAI,CAAC;IACtD,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACvC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,sBAAsB,EAAE,OAAO,CAAC;IAChC,aAAa,CAAC,EAAE,gBAAgB,CAAC;CAClC,CAAC;AAMF,eAAO,MAAM,cAAc,EAAE,mBA4N5B,CAAC"}
1
+ {"version":3,"file":"use-app-settings.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-app-settings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,8BAA8B,EAAE,MAAM,gBAAgB,CAAC;AAMtH,MAAM,MAAM,mBAAmB,GAAG,MAAM;IACtC,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;IAChC,cAAc,EAAE,8BAA8B,GAAG,IAAI,CAAC;IACtD,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACvC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,sBAAsB,EAAE,OAAO,CAAC;IAChC,aAAa,CAAC,EAAE,gBAAgB,CAAC;CAClC,CAAC;AAMF,eAAO,MAAM,cAAc,EAAE,mBAuN5B,CAAC"}
@@ -0,0 +1,4 @@
1
+ type UseAuthCloudRedirectProps = (cloudPassflowUrl: string) => () => void;
2
+ export declare const useAuthCloudRedirect: UseAuthCloudRedirectProps;
3
+ export {};
4
+ //# sourceMappingURL=use-auth-cloud-redirect.d.ts.map
@@ -0,0 +1,3 @@
1
+ import { type AuthContextValue } from '../context/index.cjs';
2
+ export declare const useAuth: () => AuthContextValue;
3
+ //# sourceMappingURL=use-auth.d.ts.map
@@ -1,3 +1,3 @@
1
- import { AuthContextValue } from '../context';
1
+ import { type AuthContextValue } from '../context/index.js';
2
2
  export declare const useAuth: () => AuthContextValue;
3
3
  //# sourceMappingURL=use-auth.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-auth.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAG/D,eAAO,MAAM,OAAO,QAAO,gBAO1B,CAAC"}
1
+ {"version":3,"file":"use-auth.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-auth.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE/D,eAAO,MAAM,OAAO,QAAO,gBAO1B,CAAC"}
@@ -0,0 +1,68 @@
1
+ /**
2
+ * The OIDC consent decision, as a hook.
3
+ *
4
+ * The URL is the bearer. `parent_challenge_id` identifies a staged
5
+ * authorization request the server is holding, and possessing that id is what
6
+ * authorizes reading it — there is no Authorization header on the GET. The
7
+ * server hands back a `csrf_token` with the request metadata, and every
8
+ * state-changing POST must carry it back in `X-Passflow-CSRF`. That token is
9
+ * the only thing separating a real decision from one a third-party page forged
10
+ * on the user's behalf, so it is never optional and never cached across
11
+ * challenges.
12
+ *
13
+ * The decision endpoints answer with a discriminated response rather than a
14
+ * redirect status, because the OIDC `response_mode` decides HOW the user gets
15
+ * back to the client: `query` is an ordinary navigation, `form_post` must be a
16
+ * POST with the parameters in a form body (they cannot go in a URL). The server
17
+ * knows which; the client just executes what it is told.
18
+ */
19
+ export type ConsentScopeMetadata = {
20
+ scope: string;
21
+ label: string;
22
+ description: string;
23
+ };
24
+ /** What GET /oidc/requests/{parent_challenge_id} hands the page to render itself. */
25
+ export type ConsentInfo = {
26
+ client_id: string;
27
+ app_name: string;
28
+ app_logo_url: string;
29
+ requested_scopes: string[];
30
+ scope_metadata: ConsentScopeMetadata[];
31
+ redirect_uri: string;
32
+ state: string;
33
+ response_mode: '' | 'query' | 'form_post';
34
+ first_party: boolean;
35
+ csrf_token: string;
36
+ };
37
+ export type ConsentStatus =
38
+ /** Fetching the staged request. */
39
+ 'loading'
40
+ /** Metadata in hand; awaiting the user's decision. */
41
+ | 'ready'
42
+ /** A decision is in flight. */
43
+ | 'working'
44
+ /** Decision accepted; the browser is on its way back to the client. */
45
+ | 'redirecting'
46
+ /** The link itself is unusable — missing, expired, or rejected id. Terminal. */
47
+ | 'invalid';
48
+ export type ConsentError = {
49
+ message: string;
50
+ description?: string;
51
+ };
52
+ export type UseConsentProps = {
53
+ status: ConsentStatus;
54
+ info: ConsentInfo | null;
55
+ /** The scopes still switched on. A subset of `info.requested_scopes`. */
56
+ grantedScopes: string[];
57
+ error: ConsentError | null;
58
+ /** Metadata for a scope, falling back to the bare scope string. */
59
+ scopeMetadata: (scope: string) => ConsentScopeMetadata;
60
+ /** Switch one requested scope on or off before deciding. */
61
+ toggleScope: (scope: string) => void;
62
+ /** Grant the currently-selected subset. */
63
+ allow: () => Promise<void>;
64
+ /** Refuse the request outright (OAuth2 `access_denied`). */
65
+ deny: () => Promise<void>;
66
+ };
67
+ export declare const useConsent: () => UseConsentProps;
68
+ //# sourceMappingURL=use-consent.d.ts.map
@@ -0,0 +1,96 @@
1
+ import type { DeviceError } from '../types/device-errors.cjs';
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
+ * When the app requires a second factor, the first ticket cannot approve: the
25
+ * server refuses it. The page asks for the factor (`/oidc/device/second-factor`)
26
+ * and approves with the ticket that answers, which records both.
27
+ */
28
+ /** The UI the server resolved for this challenge. A closed set — the client does not choose. */
29
+ export type DeviceUIMode = 'consent' | 'full_login' | 'passkey';
30
+ /** What GET /oidc/device/info hands the page to render itself. */
31
+ export type DeviceVerifyInfo = {
32
+ mode: DeviceUIMode;
33
+ /** Absent for `passkey` mode, by design — see device_page.go. */
34
+ user_code?: string;
35
+ app_name: string;
36
+ csrf_token: string;
37
+ methods: {
38
+ password: boolean;
39
+ passkey: boolean;
40
+ };
41
+ };
42
+ /** A second factor the verification page can take. */
43
+ export type DeviceSecondFactorMethod = 'totp' | 'recovery_codes';
44
+ export type DeviceVerifyStatus =
45
+ /** Asking the server what to render. */
46
+ 'loading'
47
+ /** No code yet — show the entry form. */
48
+ | 'code_entry'
49
+ /** Info in hand; awaiting the user. */
50
+ | 'ready'
51
+ /** A call is in flight. */
52
+ | 'working'
53
+ /** A first factor proven; the app wants a second before anything can be approved. */
54
+ | 'second_factor'
55
+ /** Identity proven, ticket held, not yet approved. */
56
+ | 'signed_in'
57
+ /** Approved. The terminal has its tokens. */
58
+ | 'done'
59
+ /** The mode is switched off. Terminal, and nothing approvable is rendered. */
60
+ | 'refused'
61
+ /** Terminal failure — bad/expired code, dead app. */
62
+ | 'failed';
63
+ export type UseDeviceVerifyProps = {
64
+ status: DeviceVerifyStatus;
65
+ info: DeviceVerifyInfo | null;
66
+ error: DeviceError | null;
67
+ /** The email that authenticated, once one has. */
68
+ email: string | null;
69
+ /** Whether an approval ticket is held. */
70
+ isAuthenticated: boolean;
71
+ /** Whether a first-factor ticket is waiting for its second factor. */
72
+ isSecondFactorPending: boolean;
73
+ /** The second factors the server takes, once a sign-in owes one. */
74
+ secondFactorMethods: DeviceSecondFactorMethod[];
75
+ /** Re-run the info lookup for a code typed by hand. */
76
+ submitCode: (code: string) => void;
77
+ /** Prove identity with a password. Does NOT approve. */
78
+ signInWithPassword: (email: string, password: string) => Promise<void>;
79
+ /** Prove identity with a passkey. Does NOT approve. */
80
+ signInWithPasskey: () => Promise<void>;
81
+ /** Approve, using the ticket already held. */
82
+ approve: () => Promise<void>;
83
+ /** One tap: prove identity if needed, then approve. */
84
+ confirmWithPassword: (email: string, password: string) => Promise<void>;
85
+ /** Passkey ceremony then approve, with no tap in between. */
86
+ confirmWithPasskey: () => Promise<void>;
87
+ /**
88
+ * Prove the second factor. Approves too when the act that asked for it was
89
+ * an approval (consent's tap, the passkey mode); otherwise lands on signed_in.
90
+ */
91
+ submitSecondFactor: (method: DeviceSecondFactorMethod, code: string) => Promise<void>;
92
+ /** Clear a recoverable error so the user can try again. */
93
+ clearError: () => void;
94
+ };
95
+ export declare const useDeviceVerify: () => UseDeviceVerifyProps;
96
+ //# sourceMappingURL=use-device-verify.d.ts.map
@@ -1,4 +1,4 @@
1
- import { DeviceError } from '../types/device-errors';
1
+ import type { DeviceError } from '../types/device-errors.js';
2
2
  /**
3
3
  * The RFC 8628 verification flow, as a hook.
4
4
  *