@oxyhq/services 22.12.5 → 22.12.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (639) hide show
  1. package/README.md +16 -46
  2. package/lib/commonjs/index.js +84 -10
  3. package/lib/commonjs/index.js.map +1 -1
  4. package/lib/commonjs/notifications/deviceNotifications.js +380 -0
  5. package/lib/commonjs/notifications/deviceNotifications.js.map +1 -0
  6. package/lib/commonjs/ui/boot/runProviderColdBoot.js +51 -9
  7. package/lib/commonjs/ui/boot/runProviderColdBoot.js.map +1 -1
  8. package/lib/commonjs/ui/client.js +0 -13
  9. package/lib/commonjs/ui/client.js.map +1 -1
  10. package/lib/commonjs/ui/components/AvatarCameraBadge.js +3 -2
  11. package/lib/commonjs/ui/components/AvatarCameraBadge.js.map +1 -1
  12. package/lib/commonjs/ui/components/OxyAccountDialogScreen.js +14 -3
  13. package/lib/commonjs/ui/components/OxyAccountDialogScreen.js.map +1 -1
  14. package/lib/commonjs/ui/components/OxyAuthChooser.js +70 -1121
  15. package/lib/commonjs/ui/components/OxyAuthChooser.js.map +1 -1
  16. package/lib/commonjs/ui/components/OxyConsentScreen.js +50 -12
  17. package/lib/commonjs/ui/components/OxyConsentScreen.js.map +1 -1
  18. package/lib/commonjs/ui/components/OxyProvider.js +4 -4
  19. package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
  20. package/lib/commonjs/ui/components/OxySignInButton.js +74 -40
  21. package/lib/commonjs/ui/components/OxySignInButton.js.map +1 -1
  22. package/lib/commonjs/ui/components/OxySignInRequestSurface.js +147 -0
  23. package/lib/commonjs/ui/components/OxySignInRequestSurface.js.map +1 -0
  24. package/lib/commonjs/ui/components/ProfileButton.js +4 -3
  25. package/lib/commonjs/ui/components/ProfileButton.js.map +1 -1
  26. package/lib/commonjs/ui/components/SettingsIcon.js +3 -2
  27. package/lib/commonjs/ui/components/SettingsIcon.js.map +1 -1
  28. package/lib/commonjs/ui/components/authChooser/AccountsMenuView.js +527 -0
  29. package/lib/commonjs/ui/components/authChooser/AccountsMenuView.js.map +1 -0
  30. package/lib/commonjs/ui/components/authChooser/SignInEntryView.js +90 -0
  31. package/lib/commonjs/ui/components/authChooser/SignInEntryView.js.map +1 -0
  32. package/lib/commonjs/ui/components/authChooser/SignInRequestView.js +106 -0
  33. package/lib/commonjs/ui/components/authChooser/SignInRequestView.js.map +1 -0
  34. package/lib/commonjs/ui/components/authChooser/SignUpView.js +188 -0
  35. package/lib/commonjs/ui/components/authChooser/SignUpView.js.map +1 -0
  36. package/lib/commonjs/ui/components/authChooser/TroubleDisclosure.js +61 -0
  37. package/lib/commonjs/ui/components/authChooser/TroubleDisclosure.js.map +1 -0
  38. package/lib/commonjs/ui/components/authChooser/primitives.js +170 -0
  39. package/lib/commonjs/ui/components/authChooser/primitives.js.map +1 -0
  40. package/lib/commonjs/ui/components/authChooser/requestSurfaces.js +153 -0
  41. package/lib/commonjs/ui/components/authChooser/requestSurfaces.js.map +1 -0
  42. package/lib/commonjs/ui/components/authChooser/signInProgress.js +54 -0
  43. package/lib/commonjs/ui/components/authChooser/signInProgress.js.map +1 -0
  44. package/lib/commonjs/ui/components/{oxyAuthChooserStyles.js → authChooser/styles.js} +19 -1
  45. package/lib/commonjs/ui/components/authChooser/styles.js.map +1 -0
  46. package/lib/commonjs/ui/components/authChooser/types.js +70 -0
  47. package/lib/commonjs/ui/components/authChooser/types.js.map +1 -0
  48. package/lib/commonjs/ui/components/authChooser/useUsernameAvailability.js +50 -0
  49. package/lib/commonjs/ui/components/authChooser/useUsernameAvailability.js.map +1 -0
  50. package/lib/commonjs/ui/components/fileManagement/AnimatedButton.js +3 -2
  51. package/lib/commonjs/ui/components/fileManagement/AnimatedButton.js.map +1 -1
  52. package/lib/commonjs/ui/components/fileManagement/FileDetailsModal.js +3 -2
  53. package/lib/commonjs/ui/components/fileManagement/FileDetailsModal.js.map +1 -1
  54. package/lib/commonjs/ui/components/fileManagement/FileViewer.js +15 -14
  55. package/lib/commonjs/ui/components/fileManagement/FileViewer.js.map +1 -1
  56. package/lib/commonjs/ui/components/fileManagement/UploadPreview.js +6 -5
  57. package/lib/commonjs/ui/components/fileManagement/UploadPreview.js.map +1 -1
  58. package/lib/commonjs/ui/components/modals/DeleteAccountModal.js +3 -2
  59. package/lib/commonjs/ui/components/modals/DeleteAccountModal.js.map +1 -1
  60. package/lib/commonjs/ui/components/payment/PaymentDetailsStep.js +6 -6
  61. package/lib/commonjs/ui/components/payment/PaymentDetailsStep.js.map +1 -1
  62. package/lib/commonjs/ui/components/payment/PaymentMethodStep.js +5 -5
  63. package/lib/commonjs/ui/components/payment/PaymentMethodStep.js.map +1 -1
  64. package/lib/commonjs/ui/components/payment/PaymentReviewStep.js +10 -9
  65. package/lib/commonjs/ui/components/payment/PaymentReviewStep.js.map +1 -1
  66. package/lib/commonjs/ui/components/payment/PaymentSuccessStep.js +4 -3
  67. package/lib/commonjs/ui/components/payment/PaymentSuccessStep.js.map +1 -1
  68. package/lib/commonjs/ui/components/payment/PaymentSummaryStep.js +6 -5
  69. package/lib/commonjs/ui/components/payment/PaymentSummaryStep.js.map +1 -1
  70. package/lib/commonjs/ui/context/OxyContext.js +200 -29
  71. package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
  72. package/lib/commonjs/ui/context/commitSessionFlow.js +43 -0
  73. package/lib/commonjs/ui/context/commitSessionFlow.js.map +1 -1
  74. package/lib/commonjs/ui/context/useOxyAccountGraph.js +13 -5
  75. package/lib/commonjs/ui/context/useOxyAccountGraph.js.map +1 -1
  76. package/lib/commonjs/ui/hooks/useSwitchableAccounts.js +6 -1
  77. package/lib/commonjs/ui/hooks/useSwitchableAccounts.js.map +1 -1
  78. package/lib/commonjs/ui/index.js +0 -13
  79. package/lib/commonjs/ui/index.js.map +1 -1
  80. package/lib/commonjs/ui/oauth/browserAuthTransport.js +168 -0
  81. package/lib/commonjs/ui/oauth/browserAuthTransport.js.map +1 -0
  82. package/lib/commonjs/ui/oauth/completeOAuthCode.js +78 -0
  83. package/lib/commonjs/ui/oauth/completeOAuthCode.js.map +1 -0
  84. package/lib/commonjs/ui/oauth/legacyRedirectLanes.js +48 -0
  85. package/lib/commonjs/ui/oauth/legacyRedirectLanes.js.map +1 -0
  86. package/lib/commonjs/ui/oauth/oauthHandshake.js +53 -0
  87. package/lib/commonjs/ui/oauth/oauthHandshake.js.map +1 -0
  88. package/lib/commonjs/ui/oauth/oauthPopup.js +229 -0
  89. package/lib/commonjs/ui/oauth/oauthPopup.js.map +1 -0
  90. package/lib/commonjs/ui/oauth/oauthPopupMessages.js +141 -0
  91. package/lib/commonjs/ui/oauth/oauthPopupMessages.js.map +1 -0
  92. package/lib/commonjs/ui/oauth/types.js +2 -0
  93. package/lib/commonjs/ui/oauth/types.js.map +1 -0
  94. package/lib/commonjs/ui/screens/AccountMembersScreen.js +4 -3
  95. package/lib/commonjs/ui/screens/AccountMembersScreen.js.map +1 -1
  96. package/lib/commonjs/ui/screens/CreateAccountScreen.js +7 -6
  97. package/lib/commonjs/ui/screens/CreateAccountScreen.js.map +1 -1
  98. package/lib/commonjs/ui/screens/EditProfileFieldScreen.js +4 -3
  99. package/lib/commonjs/ui/screens/EditProfileFieldScreen.js.map +1 -1
  100. package/lib/commonjs/ui/screens/FAQScreen.js +3 -2
  101. package/lib/commonjs/ui/screens/FAQScreen.js.map +1 -1
  102. package/lib/commonjs/ui/screens/FeedbackScreen.js +11 -10
  103. package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
  104. package/lib/commonjs/ui/screens/FileManagementScreen.js +19 -18
  105. package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
  106. package/lib/commonjs/ui/screens/LanguageSelectorScreen.js +4 -3
  107. package/lib/commonjs/ui/screens/LanguageSelectorScreen.js.map +1 -1
  108. package/lib/commonjs/ui/screens/ManageAccountScreen.js +2 -2
  109. package/lib/commonjs/ui/screens/ManageAccountScreen.js.map +1 -1
  110. package/lib/commonjs/ui/screens/PaymentGatewayScreen.js +3 -3
  111. package/lib/commonjs/ui/screens/PaymentGatewayScreen.js.map +1 -1
  112. package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +9 -8
  113. package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
  114. package/lib/commonjs/ui/screens/ProfileScreen.js +10 -10
  115. package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
  116. package/lib/commonjs/ui/screens/UserListScreen.js +3 -3
  117. package/lib/commonjs/ui/screens/UserListScreen.js.map +1 -1
  118. package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js +3 -2
  119. package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js.map +1 -1
  120. package/lib/commonjs/ui/screens/fileManagement/FileLibraryError.js +4 -3
  121. package/lib/commonjs/ui/screens/fileManagement/FileLibraryError.js.map +1 -1
  122. package/lib/commonjs/ui/screens/fileManagement/FileListSection.js +4 -3
  123. package/lib/commonjs/ui/screens/fileManagement/FileListSection.js.map +1 -1
  124. package/lib/commonjs/ui/screens/fileManagement/PhotoPickerSection.js +4 -3
  125. package/lib/commonjs/ui/screens/fileManagement/PhotoPickerSection.js.map +1 -1
  126. package/lib/commonjs/ui/screens/fileManagement/UploadBar.js +3 -2
  127. package/lib/commonjs/ui/screens/fileManagement/UploadBar.js.map +1 -1
  128. package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js +3 -2
  129. package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js.map +1 -1
  130. package/lib/commonjs/ui/screens/trust/TrustLeaderboardScreen.js +4 -3
  131. package/lib/commonjs/ui/screens/trust/TrustLeaderboardScreen.js.map +1 -1
  132. package/lib/commonjs/ui/screens/trust/TrustRewardsScreen.js +4 -3
  133. package/lib/commonjs/ui/screens/trust/TrustRewardsScreen.js.map +1 -1
  134. package/lib/commonjs/ui/server.js +2 -5
  135. package/lib/commonjs/ui/server.js.map +1 -1
  136. package/lib/commonjs/ui/session/authStore.js +6 -75
  137. package/lib/commonjs/ui/session/authStore.js.map +1 -1
  138. package/lib/commonjs/ui/session/createSessionClient.js +11 -3
  139. package/lib/commonjs/ui/session/createSessionClient.js.map +1 -1
  140. package/lib/commonjs/ui/session/identityBinding.js +95 -0
  141. package/lib/commonjs/ui/session/identityBinding.js.map +1 -0
  142. package/lib/commonjs/ui/session/index.js +13 -0
  143. package/lib/commonjs/ui/session/index.js.map +1 -1
  144. package/lib/commonjs/ui/session/nativeSecureStorage.js +90 -0
  145. package/lib/commonjs/ui/session/nativeSecureStorage.js.map +1 -0
  146. package/lib/commonjs/ui/session/tokenTransport.js +11 -1
  147. package/lib/commonjs/ui/session/tokenTransport.js.map +1 -1
  148. package/lib/commonjs/ui/utils/crossOriginRestore.js +1 -0
  149. package/lib/commonjs/ui/utils/crossOriginRestore.js.map +1 -1
  150. package/lib/commonjs/ui/utils/deliveryPlatform.js +58 -0
  151. package/lib/commonjs/ui/utils/deliveryPlatform.js.map +1 -0
  152. package/lib/commonjs/ui/utils/oauthReturn.js +31 -49
  153. package/lib/commonjs/ui/utils/oauthReturn.js.map +1 -1
  154. package/lib/module/index.js +27 -4
  155. package/lib/module/index.js.map +1 -1
  156. package/lib/module/notifications/deviceNotifications.js +371 -0
  157. package/lib/module/notifications/deviceNotifications.js.map +1 -0
  158. package/lib/module/ui/boot/runProviderColdBoot.js +51 -9
  159. package/lib/module/ui/boot/runProviderColdBoot.js.map +1 -1
  160. package/lib/module/ui/client.js +0 -1
  161. package/lib/module/ui/client.js.map +1 -1
  162. package/lib/module/ui/components/AvatarCameraBadge.js +1 -1
  163. package/lib/module/ui/components/AvatarCameraBadge.js.map +1 -1
  164. package/lib/module/ui/components/OxyAccountDialogScreen.js +14 -3
  165. package/lib/module/ui/components/OxyAccountDialogScreen.js.map +1 -1
  166. package/lib/module/ui/components/OxyAuthChooser.js +74 -1126
  167. package/lib/module/ui/components/OxyAuthChooser.js.map +1 -1
  168. package/lib/module/ui/components/OxyConsentScreen.js +50 -12
  169. package/lib/module/ui/components/OxyConsentScreen.js.map +1 -1
  170. package/lib/module/ui/components/OxyProvider.js +4 -4
  171. package/lib/module/ui/components/OxyProvider.js.map +1 -1
  172. package/lib/module/ui/components/OxySignInButton.js +76 -42
  173. package/lib/module/ui/components/OxySignInButton.js.map +1 -1
  174. package/lib/module/ui/components/OxySignInRequestSurface.js +141 -0
  175. package/lib/module/ui/components/OxySignInRequestSurface.js.map +1 -0
  176. package/lib/module/ui/components/ProfileButton.js +1 -1
  177. package/lib/module/ui/components/ProfileButton.js.map +1 -1
  178. package/lib/module/ui/components/SettingsIcon.js +1 -1
  179. package/lib/module/ui/components/SettingsIcon.js.map +1 -1
  180. package/lib/module/ui/components/authChooser/AccountsMenuView.js +523 -0
  181. package/lib/module/ui/components/authChooser/AccountsMenuView.js.map +1 -0
  182. package/lib/module/ui/components/authChooser/SignInEntryView.js +85 -0
  183. package/lib/module/ui/components/authChooser/SignInEntryView.js.map +1 -0
  184. package/lib/module/ui/components/authChooser/SignInRequestView.js +101 -0
  185. package/lib/module/ui/components/authChooser/SignInRequestView.js.map +1 -0
  186. package/lib/module/ui/components/authChooser/SignUpView.js +184 -0
  187. package/lib/module/ui/components/authChooser/SignUpView.js.map +1 -0
  188. package/lib/module/ui/components/authChooser/TroubleDisclosure.js +57 -0
  189. package/lib/module/ui/components/authChooser/TroubleDisclosure.js.map +1 -0
  190. package/lib/module/ui/components/authChooser/primitives.js +163 -0
  191. package/lib/module/ui/components/authChooser/primitives.js.map +1 -0
  192. package/lib/module/ui/components/authChooser/requestSurfaces.js +143 -0
  193. package/lib/module/ui/components/authChooser/requestSurfaces.js.map +1 -0
  194. package/lib/module/ui/components/authChooser/signInProgress.js +50 -0
  195. package/lib/module/ui/components/authChooser/signInProgress.js.map +1 -0
  196. package/lib/module/ui/components/{oxyAuthChooserStyles.js → authChooser/styles.js} +19 -1
  197. package/lib/module/ui/components/authChooser/styles.js.map +1 -0
  198. package/lib/module/ui/components/authChooser/types.js +66 -0
  199. package/lib/module/ui/components/authChooser/types.js.map +1 -0
  200. package/lib/module/ui/components/authChooser/useUsernameAvailability.js +46 -0
  201. package/lib/module/ui/components/authChooser/useUsernameAvailability.js.map +1 -0
  202. package/lib/module/ui/components/fileManagement/AnimatedButton.js +1 -1
  203. package/lib/module/ui/components/fileManagement/AnimatedButton.js.map +1 -1
  204. package/lib/module/ui/components/fileManagement/FileDetailsModal.js +1 -1
  205. package/lib/module/ui/components/fileManagement/FileDetailsModal.js.map +1 -1
  206. package/lib/module/ui/components/fileManagement/FileViewer.js +1 -1
  207. package/lib/module/ui/components/fileManagement/FileViewer.js.map +1 -1
  208. package/lib/module/ui/components/fileManagement/UploadPreview.js +1 -1
  209. package/lib/module/ui/components/fileManagement/UploadPreview.js.map +1 -1
  210. package/lib/module/ui/components/modals/DeleteAccountModal.js +1 -1
  211. package/lib/module/ui/components/modals/DeleteAccountModal.js.map +1 -1
  212. package/lib/module/ui/components/payment/PaymentDetailsStep.js +1 -1
  213. package/lib/module/ui/components/payment/PaymentDetailsStep.js.map +1 -1
  214. package/lib/module/ui/components/payment/PaymentMethodStep.js +1 -1
  215. package/lib/module/ui/components/payment/PaymentMethodStep.js.map +1 -1
  216. package/lib/module/ui/components/payment/PaymentReviewStep.js +1 -1
  217. package/lib/module/ui/components/payment/PaymentReviewStep.js.map +1 -1
  218. package/lib/module/ui/components/payment/PaymentSuccessStep.js +1 -1
  219. package/lib/module/ui/components/payment/PaymentSuccessStep.js.map +1 -1
  220. package/lib/module/ui/components/payment/PaymentSummaryStep.js +1 -1
  221. package/lib/module/ui/components/payment/PaymentSummaryStep.js.map +1 -1
  222. package/lib/module/ui/context/OxyContext.js +203 -32
  223. package/lib/module/ui/context/OxyContext.js.map +1 -1
  224. package/lib/module/ui/context/commitSessionFlow.js +42 -0
  225. package/lib/module/ui/context/commitSessionFlow.js.map +1 -1
  226. package/lib/module/ui/context/useOxyAccountGraph.js +13 -5
  227. package/lib/module/ui/context/useOxyAccountGraph.js.map +1 -1
  228. package/lib/module/ui/hooks/useSwitchableAccounts.js +6 -1
  229. package/lib/module/ui/hooks/useSwitchableAccounts.js.map +1 -1
  230. package/lib/module/ui/index.js +0 -1
  231. package/lib/module/ui/index.js.map +1 -1
  232. package/lib/module/ui/oauth/browserAuthTransport.js +165 -0
  233. package/lib/module/ui/oauth/browserAuthTransport.js.map +1 -0
  234. package/lib/module/ui/oauth/completeOAuthCode.js +75 -0
  235. package/lib/module/ui/oauth/completeOAuthCode.js.map +1 -0
  236. package/lib/module/ui/oauth/legacyRedirectLanes.js +44 -0
  237. package/lib/module/ui/oauth/legacyRedirectLanes.js.map +1 -0
  238. package/lib/module/ui/oauth/oauthHandshake.js +50 -0
  239. package/lib/module/ui/oauth/oauthHandshake.js.map +1 -0
  240. package/lib/module/ui/oauth/oauthPopup.js +221 -0
  241. package/lib/module/ui/oauth/oauthPopup.js.map +1 -0
  242. package/lib/module/ui/oauth/oauthPopupMessages.js +135 -0
  243. package/lib/module/ui/oauth/oauthPopupMessages.js.map +1 -0
  244. package/lib/module/ui/oauth/types.js +2 -0
  245. package/lib/module/ui/oauth/types.js.map +1 -0
  246. package/lib/module/ui/screens/AccountMembersScreen.js +1 -1
  247. package/lib/module/ui/screens/AccountMembersScreen.js.map +1 -1
  248. package/lib/module/ui/screens/CreateAccountScreen.js +1 -1
  249. package/lib/module/ui/screens/CreateAccountScreen.js.map +1 -1
  250. package/lib/module/ui/screens/EditProfileFieldScreen.js +1 -1
  251. package/lib/module/ui/screens/EditProfileFieldScreen.js.map +1 -1
  252. package/lib/module/ui/screens/FAQScreen.js +1 -1
  253. package/lib/module/ui/screens/FAQScreen.js.map +1 -1
  254. package/lib/module/ui/screens/FeedbackScreen.js +1 -1
  255. package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
  256. package/lib/module/ui/screens/FileManagementScreen.js +2 -1
  257. package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
  258. package/lib/module/ui/screens/LanguageSelectorScreen.js +1 -1
  259. package/lib/module/ui/screens/LanguageSelectorScreen.js.map +1 -1
  260. package/lib/module/ui/screens/ManageAccountScreen.js +1 -1
  261. package/lib/module/ui/screens/ManageAccountScreen.js.map +1 -1
  262. package/lib/module/ui/screens/PaymentGatewayScreen.js +1 -1
  263. package/lib/module/ui/screens/PaymentGatewayScreen.js.map +1 -1
  264. package/lib/module/ui/screens/PremiumSubscriptionScreen.js +1 -1
  265. package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
  266. package/lib/module/ui/screens/ProfileScreen.js +1 -1
  267. package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
  268. package/lib/module/ui/screens/UserListScreen.js +1 -1
  269. package/lib/module/ui/screens/UserListScreen.js.map +1 -1
  270. package/lib/module/ui/screens/WelcomeNewUserScreen.js +1 -1
  271. package/lib/module/ui/screens/WelcomeNewUserScreen.js.map +1 -1
  272. package/lib/module/ui/screens/fileManagement/FileLibraryError.js +1 -1
  273. package/lib/module/ui/screens/fileManagement/FileLibraryError.js.map +1 -1
  274. package/lib/module/ui/screens/fileManagement/FileListSection.js +1 -1
  275. package/lib/module/ui/screens/fileManagement/FileListSection.js.map +1 -1
  276. package/lib/module/ui/screens/fileManagement/PhotoPickerSection.js +2 -1
  277. package/lib/module/ui/screens/fileManagement/PhotoPickerSection.js.map +1 -1
  278. package/lib/module/ui/screens/fileManagement/UploadBar.js +1 -1
  279. package/lib/module/ui/screens/fileManagement/UploadBar.js.map +1 -1
  280. package/lib/module/ui/screens/trust/TrustCenterScreen.js +1 -1
  281. package/lib/module/ui/screens/trust/TrustCenterScreen.js.map +1 -1
  282. package/lib/module/ui/screens/trust/TrustLeaderboardScreen.js +1 -1
  283. package/lib/module/ui/screens/trust/TrustLeaderboardScreen.js.map +1 -1
  284. package/lib/module/ui/screens/trust/TrustRewardsScreen.js +1 -1
  285. package/lib/module/ui/screens/trust/TrustRewardsScreen.js.map +1 -1
  286. package/lib/module/ui/server.js +0 -2
  287. package/lib/module/ui/server.js.map +1 -1
  288. package/lib/module/ui/session/authStore.js +5 -75
  289. package/lib/module/ui/session/authStore.js.map +1 -1
  290. package/lib/module/ui/session/createSessionClient.js +11 -3
  291. package/lib/module/ui/session/createSessionClient.js.map +1 -1
  292. package/lib/module/ui/session/identityBinding.js +89 -0
  293. package/lib/module/ui/session/identityBinding.js.map +1 -0
  294. package/lib/module/ui/session/index.js +5 -2
  295. package/lib/module/ui/session/index.js.map +1 -1
  296. package/lib/module/ui/session/nativeSecureStorage.js +88 -0
  297. package/lib/module/ui/session/nativeSecureStorage.js.map +1 -0
  298. package/lib/module/ui/session/tokenTransport.js +11 -1
  299. package/lib/module/ui/session/tokenTransport.js.map +1 -1
  300. package/lib/module/ui/utils/crossOriginRestore.js +2 -1
  301. package/lib/module/ui/utils/crossOriginRestore.js.map +1 -1
  302. package/lib/module/ui/utils/deliveryPlatform.js +55 -0
  303. package/lib/module/ui/utils/deliveryPlatform.js.map +1 -0
  304. package/lib/module/ui/utils/oauthReturn.js +32 -49
  305. package/lib/module/ui/utils/oauthReturn.js.map +1 -1
  306. package/lib/typescript/commonjs/index.d.ts +9 -1
  307. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  308. package/lib/typescript/commonjs/notifications/deviceNotifications.d.ts +141 -0
  309. package/lib/typescript/commonjs/notifications/deviceNotifications.d.ts.map +1 -0
  310. package/lib/typescript/commonjs/ui/boot/runProviderColdBoot.d.ts +34 -2
  311. package/lib/typescript/commonjs/ui/boot/runProviderColdBoot.d.ts.map +1 -1
  312. package/lib/typescript/commonjs/ui/client.d.ts +0 -1
  313. package/lib/typescript/commonjs/ui/client.d.ts.map +1 -1
  314. package/lib/typescript/commonjs/ui/components/OxyAccountDialogScreen.d.ts.map +1 -1
  315. package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts +16 -29
  316. package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts.map +1 -1
  317. package/lib/typescript/commonjs/ui/components/OxyConsentScreen.d.ts.map +1 -1
  318. package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts.map +1 -1
  319. package/lib/typescript/commonjs/ui/components/OxySignInButton.d.ts +17 -12
  320. package/lib/typescript/commonjs/ui/components/OxySignInButton.d.ts.map +1 -1
  321. package/lib/typescript/commonjs/ui/components/OxySignInRequestSurface.d.ts +108 -0
  322. package/lib/typescript/commonjs/ui/components/OxySignInRequestSurface.d.ts.map +1 -0
  323. package/lib/typescript/commonjs/ui/components/SettingsIcon.d.ts +1 -1
  324. package/lib/typescript/commonjs/ui/components/SettingsIcon.d.ts.map +1 -1
  325. package/lib/typescript/commonjs/ui/components/authChooser/AccountsMenuView.d.ts +38 -0
  326. package/lib/typescript/commonjs/ui/components/authChooser/AccountsMenuView.d.ts.map +1 -0
  327. package/lib/typescript/commonjs/ui/components/authChooser/SignInEntryView.d.ts +32 -0
  328. package/lib/typescript/commonjs/ui/components/authChooser/SignInEntryView.d.ts.map +1 -0
  329. package/lib/typescript/commonjs/ui/components/authChooser/SignInRequestView.d.ts +34 -0
  330. package/lib/typescript/commonjs/ui/components/authChooser/SignInRequestView.d.ts.map +1 -0
  331. package/lib/typescript/commonjs/ui/components/authChooser/SignUpView.d.ts +34 -0
  332. package/lib/typescript/commonjs/ui/components/authChooser/SignUpView.d.ts.map +1 -0
  333. package/lib/typescript/commonjs/ui/components/authChooser/TroubleDisclosure.d.ts +36 -0
  334. package/lib/typescript/commonjs/ui/components/authChooser/TroubleDisclosure.d.ts.map +1 -0
  335. package/lib/typescript/commonjs/ui/components/authChooser/primitives.d.ts +55 -0
  336. package/lib/typescript/commonjs/ui/components/authChooser/primitives.d.ts.map +1 -0
  337. package/lib/typescript/commonjs/ui/components/authChooser/requestSurfaces.d.ts +58 -0
  338. package/lib/typescript/commonjs/ui/components/authChooser/requestSurfaces.d.ts.map +1 -0
  339. package/lib/typescript/commonjs/ui/components/authChooser/signInProgress.d.ts +26 -0
  340. package/lib/typescript/commonjs/ui/components/authChooser/signInProgress.d.ts.map +1 -0
  341. package/lib/typescript/{module/ui/components/oxyAuthChooserStyles.d.ts → commonjs/ui/components/authChooser/styles.d.ts} +19 -1
  342. package/lib/typescript/commonjs/ui/components/authChooser/styles.d.ts.map +1 -0
  343. package/lib/typescript/commonjs/ui/components/authChooser/types.d.ts +103 -0
  344. package/lib/typescript/commonjs/ui/components/authChooser/types.d.ts.map +1 -0
  345. package/lib/typescript/commonjs/ui/components/authChooser/useUsernameAvailability.d.ts +16 -0
  346. package/lib/typescript/commonjs/ui/components/authChooser/useUsernameAvailability.d.ts.map +1 -0
  347. package/lib/typescript/commonjs/ui/components/payment/types.d.ts +1 -1
  348. package/lib/typescript/commonjs/ui/components/payment/types.d.ts.map +1 -1
  349. package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
  350. package/lib/typescript/commonjs/ui/context/commitSessionFlow.d.ts +40 -0
  351. package/lib/typescript/commonjs/ui/context/commitSessionFlow.d.ts.map +1 -1
  352. package/lib/typescript/commonjs/ui/context/oxyContextTypes.d.ts +44 -1
  353. package/lib/typescript/commonjs/ui/context/oxyContextTypes.d.ts.map +1 -1
  354. package/lib/typescript/commonjs/ui/context/useOxyAccountGraph.d.ts +7 -1
  355. package/lib/typescript/commonjs/ui/context/useOxyAccountGraph.d.ts.map +1 -1
  356. package/lib/typescript/commonjs/ui/hooks/useSwitchableAccounts.d.ts.map +1 -1
  357. package/lib/typescript/commonjs/ui/index.d.ts +0 -1
  358. package/lib/typescript/commonjs/ui/index.d.ts.map +1 -1
  359. package/lib/typescript/commonjs/ui/oauth/browserAuthTransport.d.ts +56 -0
  360. package/lib/typescript/commonjs/ui/oauth/browserAuthTransport.d.ts.map +1 -0
  361. package/lib/typescript/commonjs/ui/oauth/completeOAuthCode.d.ts +49 -0
  362. package/lib/typescript/commonjs/ui/oauth/completeOAuthCode.d.ts.map +1 -0
  363. package/lib/typescript/commonjs/ui/oauth/legacyRedirectLanes.d.ts +40 -0
  364. package/lib/typescript/commonjs/ui/oauth/legacyRedirectLanes.d.ts.map +1 -0
  365. package/lib/typescript/commonjs/ui/oauth/oauthHandshake.d.ts +50 -0
  366. package/lib/typescript/commonjs/ui/oauth/oauthHandshake.d.ts.map +1 -0
  367. package/lib/typescript/commonjs/ui/oauth/oauthPopup.d.ts +77 -0
  368. package/lib/typescript/commonjs/ui/oauth/oauthPopup.d.ts.map +1 -0
  369. package/lib/typescript/commonjs/ui/oauth/oauthPopupMessages.d.ts +67 -0
  370. package/lib/typescript/commonjs/ui/oauth/oauthPopupMessages.d.ts.map +1 -0
  371. package/lib/typescript/commonjs/ui/oauth/types.d.ts +176 -0
  372. package/lib/typescript/commonjs/ui/oauth/types.d.ts.map +1 -0
  373. package/lib/typescript/commonjs/ui/screens/FeedbackScreen.d.ts.map +1 -1
  374. package/lib/typescript/commonjs/ui/screens/FileManagementScreen.d.ts.map +1 -1
  375. package/lib/typescript/commonjs/ui/screens/fileManagement/PhotoPickerSection.d.ts.map +1 -1
  376. package/lib/typescript/commonjs/ui/server.d.ts +0 -2
  377. package/lib/typescript/commonjs/ui/server.d.ts.map +1 -1
  378. package/lib/typescript/commonjs/ui/session/authStore.d.ts +3 -7
  379. package/lib/typescript/commonjs/ui/session/authStore.d.ts.map +1 -1
  380. package/lib/typescript/commonjs/ui/session/createSessionClient.d.ts +8 -1
  381. package/lib/typescript/commonjs/ui/session/createSessionClient.d.ts.map +1 -1
  382. package/lib/typescript/commonjs/ui/session/identityBinding.d.ts +66 -0
  383. package/lib/typescript/commonjs/ui/session/identityBinding.d.ts.map +1 -0
  384. package/lib/typescript/commonjs/ui/session/index.d.ts +6 -2
  385. package/lib/typescript/commonjs/ui/session/index.d.ts.map +1 -1
  386. package/lib/typescript/commonjs/ui/session/nativeSecureStorage.d.ts +25 -0
  387. package/lib/typescript/commonjs/ui/session/nativeSecureStorage.d.ts.map +1 -0
  388. package/lib/typescript/commonjs/ui/session/tokenTransport.d.ts +8 -1
  389. package/lib/typescript/commonjs/ui/session/tokenTransport.d.ts.map +1 -1
  390. package/lib/typescript/commonjs/ui/types/navigation.d.ts +44 -0
  391. package/lib/typescript/commonjs/ui/types/navigation.d.ts.map +1 -1
  392. package/lib/typescript/commonjs/ui/utils/crossOriginRestore.d.ts.map +1 -1
  393. package/lib/typescript/commonjs/ui/utils/deliveryPlatform.d.ts +33 -0
  394. package/lib/typescript/commonjs/ui/utils/deliveryPlatform.d.ts.map +1 -0
  395. package/lib/typescript/commonjs/ui/utils/fileManagement.d.ts +1 -1
  396. package/lib/typescript/commonjs/ui/utils/fileManagement.d.ts.map +1 -1
  397. package/lib/typescript/commonjs/ui/utils/oauthReturn.d.ts +11 -16
  398. package/lib/typescript/commonjs/ui/utils/oauthReturn.d.ts.map +1 -1
  399. package/lib/typescript/module/index.d.ts +9 -1
  400. package/lib/typescript/module/index.d.ts.map +1 -1
  401. package/lib/typescript/module/notifications/deviceNotifications.d.ts +141 -0
  402. package/lib/typescript/module/notifications/deviceNotifications.d.ts.map +1 -0
  403. package/lib/typescript/module/ui/boot/runProviderColdBoot.d.ts +34 -2
  404. package/lib/typescript/module/ui/boot/runProviderColdBoot.d.ts.map +1 -1
  405. package/lib/typescript/module/ui/client.d.ts +0 -1
  406. package/lib/typescript/module/ui/client.d.ts.map +1 -1
  407. package/lib/typescript/module/ui/components/OxyAccountDialogScreen.d.ts.map +1 -1
  408. package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts +16 -29
  409. package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts.map +1 -1
  410. package/lib/typescript/module/ui/components/OxyConsentScreen.d.ts.map +1 -1
  411. package/lib/typescript/module/ui/components/OxyProvider.d.ts.map +1 -1
  412. package/lib/typescript/module/ui/components/OxySignInButton.d.ts +17 -12
  413. package/lib/typescript/module/ui/components/OxySignInButton.d.ts.map +1 -1
  414. package/lib/typescript/module/ui/components/OxySignInRequestSurface.d.ts +108 -0
  415. package/lib/typescript/module/ui/components/OxySignInRequestSurface.d.ts.map +1 -0
  416. package/lib/typescript/module/ui/components/SettingsIcon.d.ts +1 -1
  417. package/lib/typescript/module/ui/components/SettingsIcon.d.ts.map +1 -1
  418. package/lib/typescript/module/ui/components/authChooser/AccountsMenuView.d.ts +38 -0
  419. package/lib/typescript/module/ui/components/authChooser/AccountsMenuView.d.ts.map +1 -0
  420. package/lib/typescript/module/ui/components/authChooser/SignInEntryView.d.ts +32 -0
  421. package/lib/typescript/module/ui/components/authChooser/SignInEntryView.d.ts.map +1 -0
  422. package/lib/typescript/module/ui/components/authChooser/SignInRequestView.d.ts +34 -0
  423. package/lib/typescript/module/ui/components/authChooser/SignInRequestView.d.ts.map +1 -0
  424. package/lib/typescript/module/ui/components/authChooser/SignUpView.d.ts +34 -0
  425. package/lib/typescript/module/ui/components/authChooser/SignUpView.d.ts.map +1 -0
  426. package/lib/typescript/module/ui/components/authChooser/TroubleDisclosure.d.ts +36 -0
  427. package/lib/typescript/module/ui/components/authChooser/TroubleDisclosure.d.ts.map +1 -0
  428. package/lib/typescript/module/ui/components/authChooser/primitives.d.ts +55 -0
  429. package/lib/typescript/module/ui/components/authChooser/primitives.d.ts.map +1 -0
  430. package/lib/typescript/module/ui/components/authChooser/requestSurfaces.d.ts +58 -0
  431. package/lib/typescript/module/ui/components/authChooser/requestSurfaces.d.ts.map +1 -0
  432. package/lib/typescript/module/ui/components/authChooser/signInProgress.d.ts +26 -0
  433. package/lib/typescript/module/ui/components/authChooser/signInProgress.d.ts.map +1 -0
  434. package/lib/typescript/{commonjs/ui/components/oxyAuthChooserStyles.d.ts → module/ui/components/authChooser/styles.d.ts} +19 -1
  435. package/lib/typescript/module/ui/components/authChooser/styles.d.ts.map +1 -0
  436. package/lib/typescript/module/ui/components/authChooser/types.d.ts +103 -0
  437. package/lib/typescript/module/ui/components/authChooser/types.d.ts.map +1 -0
  438. package/lib/typescript/module/ui/components/authChooser/useUsernameAvailability.d.ts +16 -0
  439. package/lib/typescript/module/ui/components/authChooser/useUsernameAvailability.d.ts.map +1 -0
  440. package/lib/typescript/module/ui/components/payment/types.d.ts +1 -1
  441. package/lib/typescript/module/ui/components/payment/types.d.ts.map +1 -1
  442. package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
  443. package/lib/typescript/module/ui/context/commitSessionFlow.d.ts +40 -0
  444. package/lib/typescript/module/ui/context/commitSessionFlow.d.ts.map +1 -1
  445. package/lib/typescript/module/ui/context/oxyContextTypes.d.ts +44 -1
  446. package/lib/typescript/module/ui/context/oxyContextTypes.d.ts.map +1 -1
  447. package/lib/typescript/module/ui/context/useOxyAccountGraph.d.ts +7 -1
  448. package/lib/typescript/module/ui/context/useOxyAccountGraph.d.ts.map +1 -1
  449. package/lib/typescript/module/ui/hooks/useSwitchableAccounts.d.ts.map +1 -1
  450. package/lib/typescript/module/ui/index.d.ts +0 -1
  451. package/lib/typescript/module/ui/index.d.ts.map +1 -1
  452. package/lib/typescript/module/ui/oauth/browserAuthTransport.d.ts +56 -0
  453. package/lib/typescript/module/ui/oauth/browserAuthTransport.d.ts.map +1 -0
  454. package/lib/typescript/module/ui/oauth/completeOAuthCode.d.ts +49 -0
  455. package/lib/typescript/module/ui/oauth/completeOAuthCode.d.ts.map +1 -0
  456. package/lib/typescript/module/ui/oauth/legacyRedirectLanes.d.ts +40 -0
  457. package/lib/typescript/module/ui/oauth/legacyRedirectLanes.d.ts.map +1 -0
  458. package/lib/typescript/module/ui/oauth/oauthHandshake.d.ts +50 -0
  459. package/lib/typescript/module/ui/oauth/oauthHandshake.d.ts.map +1 -0
  460. package/lib/typescript/module/ui/oauth/oauthPopup.d.ts +77 -0
  461. package/lib/typescript/module/ui/oauth/oauthPopup.d.ts.map +1 -0
  462. package/lib/typescript/module/ui/oauth/oauthPopupMessages.d.ts +67 -0
  463. package/lib/typescript/module/ui/oauth/oauthPopupMessages.d.ts.map +1 -0
  464. package/lib/typescript/module/ui/oauth/types.d.ts +176 -0
  465. package/lib/typescript/module/ui/oauth/types.d.ts.map +1 -0
  466. package/lib/typescript/module/ui/screens/FeedbackScreen.d.ts.map +1 -1
  467. package/lib/typescript/module/ui/screens/FileManagementScreen.d.ts.map +1 -1
  468. package/lib/typescript/module/ui/screens/fileManagement/PhotoPickerSection.d.ts.map +1 -1
  469. package/lib/typescript/module/ui/server.d.ts +0 -2
  470. package/lib/typescript/module/ui/server.d.ts.map +1 -1
  471. package/lib/typescript/module/ui/session/authStore.d.ts +3 -7
  472. package/lib/typescript/module/ui/session/authStore.d.ts.map +1 -1
  473. package/lib/typescript/module/ui/session/createSessionClient.d.ts +8 -1
  474. package/lib/typescript/module/ui/session/createSessionClient.d.ts.map +1 -1
  475. package/lib/typescript/module/ui/session/identityBinding.d.ts +66 -0
  476. package/lib/typescript/module/ui/session/identityBinding.d.ts.map +1 -0
  477. package/lib/typescript/module/ui/session/index.d.ts +6 -2
  478. package/lib/typescript/module/ui/session/index.d.ts.map +1 -1
  479. package/lib/typescript/module/ui/session/nativeSecureStorage.d.ts +25 -0
  480. package/lib/typescript/module/ui/session/nativeSecureStorage.d.ts.map +1 -0
  481. package/lib/typescript/module/ui/session/tokenTransport.d.ts +8 -1
  482. package/lib/typescript/module/ui/session/tokenTransport.d.ts.map +1 -1
  483. package/lib/typescript/module/ui/types/navigation.d.ts +44 -0
  484. package/lib/typescript/module/ui/types/navigation.d.ts.map +1 -1
  485. package/lib/typescript/module/ui/utils/crossOriginRestore.d.ts.map +1 -1
  486. package/lib/typescript/module/ui/utils/deliveryPlatform.d.ts +33 -0
  487. package/lib/typescript/module/ui/utils/deliveryPlatform.d.ts.map +1 -0
  488. package/lib/typescript/module/ui/utils/fileManagement.d.ts +1 -1
  489. package/lib/typescript/module/ui/utils/fileManagement.d.ts.map +1 -1
  490. package/lib/typescript/module/ui/utils/oauthReturn.d.ts +11 -16
  491. package/lib/typescript/module/ui/utils/oauthReturn.d.ts.map +1 -1
  492. package/package.json +12 -4
  493. package/src/index.ts +50 -5
  494. package/src/notifications/deviceNotifications.ts +395 -0
  495. package/src/ui/boot/__tests__/coldBootWebAuthMode.test.ts +281 -0
  496. package/src/ui/boot/runProviderColdBoot.ts +83 -13
  497. package/src/ui/client.ts +0 -1
  498. package/src/ui/components/AvatarCameraBadge.tsx +1 -1
  499. package/src/ui/components/OxyAccountDialogScreen.tsx +20 -3
  500. package/src/ui/components/OxyAuthChooser.tsx +91 -1230
  501. package/src/ui/components/OxyConsentScreen.tsx +56 -13
  502. package/src/ui/components/OxyProvider.tsx +4 -4
  503. package/src/ui/components/OxySignInButton.tsx +119 -78
  504. package/src/ui/components/OxySignInRequestSurface.tsx +202 -0
  505. package/src/ui/components/ProfileButton.tsx +1 -1
  506. package/src/ui/components/SettingsIcon.tsx +1 -1
  507. package/src/ui/components/__tests__/OxyConsentScreen.test.tsx +27 -0
  508. package/src/ui/components/authChooser/AccountsMenuView.tsx +569 -0
  509. package/src/ui/components/authChooser/SignInEntryView.tsx +121 -0
  510. package/src/ui/components/authChooser/SignInRequestView.tsx +130 -0
  511. package/src/ui/components/authChooser/SignUpView.tsx +174 -0
  512. package/src/ui/components/authChooser/TroubleDisclosure.tsx +73 -0
  513. package/src/ui/components/authChooser/primitives.tsx +144 -0
  514. package/src/ui/components/authChooser/requestSurfaces.tsx +120 -0
  515. package/src/ui/components/authChooser/signInProgress.ts +54 -0
  516. package/src/ui/components/{oxyAuthChooserStyles.ts → authChooser/styles.ts} +18 -0
  517. package/src/ui/components/authChooser/types.ts +120 -0
  518. package/src/ui/components/authChooser/useUsernameAvailability.ts +60 -0
  519. package/src/ui/components/fileManagement/AnimatedButton.tsx +1 -1
  520. package/src/ui/components/fileManagement/FileDetailsModal.tsx +1 -1
  521. package/src/ui/components/fileManagement/FileViewer.tsx +1 -1
  522. package/src/ui/components/fileManagement/UploadPreview.tsx +1 -1
  523. package/src/ui/components/modals/DeleteAccountModal.tsx +1 -1
  524. package/src/ui/components/payment/PaymentDetailsStep.tsx +1 -1
  525. package/src/ui/components/payment/PaymentMethodStep.tsx +1 -1
  526. package/src/ui/components/payment/PaymentReviewStep.tsx +1 -1
  527. package/src/ui/components/payment/PaymentSuccessStep.tsx +1 -1
  528. package/src/ui/components/payment/PaymentSummaryStep.tsx +1 -1
  529. package/src/ui/components/payment/types.ts +1 -1
  530. package/src/ui/context/OxyContext.tsx +220 -24
  531. package/src/ui/context/__tests__/commitSessionFlow.test.ts +89 -0
  532. package/src/ui/context/commitSessionFlow.ts +61 -0
  533. package/src/ui/context/oxyContextTypes.ts +45 -1
  534. package/src/ui/context/useOxyAccountGraph.ts +19 -5
  535. package/src/ui/hooks/useSwitchableAccounts.ts +12 -1
  536. package/src/ui/index.ts +0 -1
  537. package/src/ui/oauth/__tests__/browserAuthTransport.test.ts +335 -0
  538. package/src/ui/oauth/__tests__/completeOAuthCode.test.ts +142 -0
  539. package/src/ui/oauth/__tests__/oauthPopup.test.ts +326 -0
  540. package/src/ui/oauth/__tests__/oauthPopupMessages.test.ts +189 -0
  541. package/src/ui/oauth/__tests__/sharedCompletionPath.test.ts +174 -0
  542. package/src/ui/oauth/browserAuthTransport.ts +187 -0
  543. package/src/ui/oauth/completeOAuthCode.ts +93 -0
  544. package/src/ui/oauth/legacyRedirectLanes.ts +43 -0
  545. package/src/ui/oauth/oauthHandshake.ts +74 -0
  546. package/src/ui/oauth/oauthPopup.ts +219 -0
  547. package/src/ui/oauth/oauthPopupMessages.ts +136 -0
  548. package/src/ui/oauth/types.ts +150 -0
  549. package/src/ui/screens/AccountMembersScreen.tsx +1 -1
  550. package/src/ui/screens/CreateAccountScreen.tsx +1 -1
  551. package/src/ui/screens/EditProfileFieldScreen.tsx +1 -1
  552. package/src/ui/screens/FAQScreen.tsx +1 -1
  553. package/src/ui/screens/FeedbackScreen.tsx +2 -1
  554. package/src/ui/screens/FileManagementScreen.tsx +2 -1
  555. package/src/ui/screens/LanguageSelectorScreen.tsx +1 -1
  556. package/src/ui/screens/ManageAccountScreen.tsx +1 -1
  557. package/src/ui/screens/PaymentGatewayScreen.tsx +1 -1
  558. package/src/ui/screens/PremiumSubscriptionScreen.tsx +1 -1
  559. package/src/ui/screens/ProfileScreen.tsx +1 -1
  560. package/src/ui/screens/UserListScreen.tsx +1 -1
  561. package/src/ui/screens/WelcomeNewUserScreen.tsx +1 -1
  562. package/src/ui/screens/fileManagement/FileLibraryError.tsx +1 -1
  563. package/src/ui/screens/fileManagement/FileListSection.tsx +1 -1
  564. package/src/ui/screens/fileManagement/PhotoPickerSection.tsx +2 -1
  565. package/src/ui/screens/fileManagement/UploadBar.tsx +1 -1
  566. package/src/ui/screens/trust/TrustCenterScreen.tsx +1 -1
  567. package/src/ui/screens/trust/TrustLeaderboardScreen.tsx +1 -1
  568. package/src/ui/screens/trust/TrustRewardsScreen.tsx +1 -1
  569. package/src/ui/server.ts +0 -2
  570. package/src/ui/session/__tests__/createSessionClient.test.ts +26 -0
  571. package/src/ui/session/__tests__/tokenTransport.test.ts +34 -0
  572. package/src/ui/session/authStore.ts +5 -89
  573. package/src/ui/session/createSessionClient.ts +15 -2
  574. package/src/ui/session/identityBinding.ts +116 -0
  575. package/src/ui/session/index.ts +6 -2
  576. package/src/ui/session/nativeSecureStorage.ts +98 -0
  577. package/src/ui/session/tokenTransport.ts +14 -1
  578. package/src/ui/types/navigation.ts +44 -1
  579. package/src/ui/utils/crossOriginRestore.ts +2 -0
  580. package/src/ui/utils/deliveryPlatform.ts +65 -0
  581. package/src/ui/utils/fileManagement.ts +1 -1
  582. package/src/ui/utils/oauthReturn.ts +34 -63
  583. package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-Black.ttf +0 -0
  584. package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-Bold.ttf +0 -0
  585. package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-ExtraBold.ttf +0 -0
  586. package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-Light.ttf +0 -0
  587. package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-Medium.ttf +0 -0
  588. package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-Regular.ttf +0 -0
  589. package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-SemiBold.ttf +0 -0
  590. package/lib/commonjs/assets/fonts/Inter/Inter_18pt-Black.ttf +0 -0
  591. package/lib/commonjs/assets/fonts/Inter/Inter_18pt-Bold.ttf +0 -0
  592. package/lib/commonjs/assets/fonts/Inter/Inter_18pt-ExtraBold.ttf +0 -0
  593. package/lib/commonjs/assets/fonts/Inter/Inter_18pt-Light.ttf +0 -0
  594. package/lib/commonjs/assets/fonts/Inter/Inter_18pt-Medium.ttf +0 -0
  595. package/lib/commonjs/assets/fonts/Inter/Inter_18pt-Regular.ttf +0 -0
  596. package/lib/commonjs/assets/fonts/Inter/Inter_18pt-SemiBold.ttf +0 -0
  597. package/lib/commonjs/ui/components/FontLoader.js +0 -35
  598. package/lib/commonjs/ui/components/FontLoader.js.map +0 -1
  599. package/lib/commonjs/ui/components/FontLoader.native.js +0 -88
  600. package/lib/commonjs/ui/components/FontLoader.native.js.map +0 -1
  601. package/lib/commonjs/ui/components/oxyAuthChooserStyles.js.map +0 -1
  602. package/lib/module/assets/assets/fonts/Inter/Inter_18pt-Black.ttf +0 -0
  603. package/lib/module/assets/assets/fonts/Inter/Inter_18pt-Bold.ttf +0 -0
  604. package/lib/module/assets/assets/fonts/Inter/Inter_18pt-ExtraBold.ttf +0 -0
  605. package/lib/module/assets/assets/fonts/Inter/Inter_18pt-Light.ttf +0 -0
  606. package/lib/module/assets/assets/fonts/Inter/Inter_18pt-Medium.ttf +0 -0
  607. package/lib/module/assets/assets/fonts/Inter/Inter_18pt-Regular.ttf +0 -0
  608. package/lib/module/assets/assets/fonts/Inter/Inter_18pt-SemiBold.ttf +0 -0
  609. package/lib/module/assets/fonts/Inter/Inter_18pt-Black.ttf +0 -0
  610. package/lib/module/assets/fonts/Inter/Inter_18pt-Bold.ttf +0 -0
  611. package/lib/module/assets/fonts/Inter/Inter_18pt-ExtraBold.ttf +0 -0
  612. package/lib/module/assets/fonts/Inter/Inter_18pt-Light.ttf +0 -0
  613. package/lib/module/assets/fonts/Inter/Inter_18pt-Medium.ttf +0 -0
  614. package/lib/module/assets/fonts/Inter/Inter_18pt-Regular.ttf +0 -0
  615. package/lib/module/assets/fonts/Inter/Inter_18pt-SemiBold.ttf +0 -0
  616. package/lib/module/ui/components/FontLoader.js +0 -29
  617. package/lib/module/ui/components/FontLoader.js.map +0 -1
  618. package/lib/module/ui/components/FontLoader.native.js +0 -83
  619. package/lib/module/ui/components/FontLoader.native.js.map +0 -1
  620. package/lib/module/ui/components/oxyAuthChooserStyles.js.map +0 -1
  621. package/lib/typescript/commonjs/ui/components/FontLoader.d.ts +0 -24
  622. package/lib/typescript/commonjs/ui/components/FontLoader.d.ts.map +0 -1
  623. package/lib/typescript/commonjs/ui/components/FontLoader.native.d.ts +0 -13
  624. package/lib/typescript/commonjs/ui/components/FontLoader.native.d.ts.map +0 -1
  625. package/lib/typescript/commonjs/ui/components/oxyAuthChooserStyles.d.ts.map +0 -1
  626. package/lib/typescript/module/ui/components/FontLoader.d.ts +0 -24
  627. package/lib/typescript/module/ui/components/FontLoader.d.ts.map +0 -1
  628. package/lib/typescript/module/ui/components/FontLoader.native.d.ts +0 -13
  629. package/lib/typescript/module/ui/components/FontLoader.native.d.ts.map +0 -1
  630. package/lib/typescript/module/ui/components/oxyAuthChooserStyles.d.ts.map +0 -1
  631. package/src/assets/fonts/Inter/Inter_18pt-Black.ttf +0 -0
  632. package/src/assets/fonts/Inter/Inter_18pt-Bold.ttf +0 -0
  633. package/src/assets/fonts/Inter/Inter_18pt-ExtraBold.ttf +0 -0
  634. package/src/assets/fonts/Inter/Inter_18pt-Light.ttf +0 -0
  635. package/src/assets/fonts/Inter/Inter_18pt-Medium.ttf +0 -0
  636. package/src/assets/fonts/Inter/Inter_18pt-Regular.ttf +0 -0
  637. package/src/assets/fonts/Inter/Inter_18pt-SemiBold.ttf +0 -0
  638. package/src/ui/components/FontLoader.native.tsx +0 -88
  639. package/src/ui/components/FontLoader.tsx +0 -27
@@ -21,6 +21,7 @@ import type {
21
21
  } from '@oxyhq/core';
22
22
  import {
23
23
  KeyManager,
24
+ establishIdentitySession,
24
25
  installAuthRefreshHandler,
25
26
  startTokenRefreshScheduler,
26
27
  createAccountDialogController,
@@ -33,7 +34,13 @@ import {
33
34
  } from '../navigation/accountDialogManager';
34
35
  import { redirectToAuthorize } from '../components/oauthNavigation';
35
36
  import { openPasskeyHubPopup } from '../components/passkeyHubPopup';
37
+ import {
38
+ startWebOAuthSignIn,
39
+ type StartWebOAuthSignInOptions,
40
+ } from '../oauth/browserAuthTransport';
41
+ import type { WebOAuthSignInResult } from '../oauth/types';
36
42
  import { isWebBrowser } from '../utils/isWebBrowser';
43
+ import { resolveDeliveryPlatform } from '../utils/deliveryPlatform';
37
44
  import { runProviderColdBoot } from '../boot/runProviderColdBoot';
38
45
  import { loadPersistedDeviceCredential } from '../utils/deviceCredential';
39
46
  import { useAuthStore, type AuthState } from '../stores/authStore';
@@ -57,11 +64,14 @@ import { useAvatarPicker } from '../hooks/useAvatarPicker';
57
64
  import { useAccountStore } from '../stores/accountStore';
58
65
  import {
59
66
  createSessionClient,
67
+ createIdentitySessionBinding,
60
68
  createPlatformAuthStateStore,
61
69
  deviceStateToClientSessions,
62
70
  activeSessionIdOf,
63
71
  activeUserOf,
64
72
  accountIdsOf,
73
+ IdentityBoundSessionError,
74
+ type IdentitySessionBinding,
65
75
  } from '../session';
66
76
  import type {
67
77
  OxyContextState,
@@ -69,7 +79,7 @@ import type {
69
79
  CommitInput,
70
80
  } from './oxyContextTypes';
71
81
  import { DEFAULT_SESSION_VALIDITY_MS, loadUseFollowHook } from './oxyContextHelpers';
72
- import { commitDeviceSetAndResolve } from './commitSessionFlow';
82
+ import { commitDeviceSetAndResolve, maybeSyncHubAfterCommit } from './commitSessionFlow';
73
83
  import { runPasskeyLogin, runPasskeyRegister, runPasskeyAdd } from './passkeyFlow';
74
84
  import {
75
85
  isPasskeySupported,
@@ -92,6 +102,8 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
92
102
  authorizeBaseUrl,
93
103
  storageKeyPrefix = 'oxy_session',
94
104
  clientId: clientIdProp,
105
+ sessionMode = 'account',
106
+ webAuthMode = 'redirect',
95
107
  hubSync = true,
96
108
  onAuthStateChange,
97
109
  onError,
@@ -119,6 +131,23 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
119
131
  }
120
132
  const authStore = authStoreRef.current;
121
133
 
134
+ // Identity-bound session binding (`sessionMode: 'identity'`) — the platform pin
135
+ // store plus the memoised pinned account id every lane below binds to. Built
136
+ // ONCE per provider mount and ONLY in identity mode: an account-mode provider
137
+ // never constructs one, so `identity` is `null` there and every branch keyed on
138
+ // it collapses to today's behaviour.
139
+ //
140
+ // Like `oxyServices` / `baseURL`, `sessionMode` is mount-time configuration: it
141
+ // is read once and a later change does not re-bind the provider. Latching it
142
+ // this way also fails SAFE — a provider that started identity-bound can never
143
+ // be downgraded mid-flight into following the device's active account.
144
+ const identityRef = useRef<IdentitySessionBinding | null>(null);
145
+ if (sessionMode === 'identity' && !identityRef.current) {
146
+ identityRef.current = createIdentitySessionBinding();
147
+ }
148
+ const identity = identityRef.current;
149
+ const isIdentityBound = identity !== null;
150
+
122
151
  const {
123
152
  user,
124
153
  isAuthenticated,
@@ -309,10 +338,65 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
309
338
  logger('Failed to clear local state on remote sign-out', clearError);
310
339
  });
311
340
  },
341
+ // `null` for every account-mode provider — identical to omitting the
342
+ // option — and the pinned account id once an identity-bound provider has
343
+ // resolved its pin. Read through the ref so the resolver stays stable for
344
+ // the client's lifetime while still seeing later resolutions.
345
+ () => identityRef.current?.getPinnedAccountId() ?? null,
312
346
  );
313
347
  }
314
348
  const { client: sessionClient, host: sessionClientHost } = sessionClientPairRef.current;
315
349
 
350
+ // Re-establishment lane for an identity-bound provider whose pin is missing or
351
+ // whose pinned account is no longer part of this device's session set (another
352
+ // app signed it out, or the device was re-provisioned). Adopting whichever
353
+ // account the device is currently switched to is exactly the drift
354
+ // `sessionMode: 'identity'` exists to prevent, so the only correct answer is to
355
+ // re-derive the session from the local identity key.
356
+ //
357
+ // Bounded on purpose: at most ONE attempt per applied device revision, and
358
+ // never two concurrently — a repeated failure (locked keychain, offline, no
359
+ // local identity) must never spin a sign-in loop against the server. Nothing
360
+ // awaits it, so it can never deadlock against the projection that triggers it;
361
+ // the `bootstrap()` below re-applies device state, whose notify re-runs the
362
+ // projection with the pin now resolved.
363
+ const identityEstablishRef = useRef<{ revision: number | null; inFlight: boolean }>({
364
+ revision: null,
365
+ inFlight: false,
366
+ });
367
+
368
+ const reestablishIdentitySession = useCallback(
369
+ (binding: IdentitySessionBinding, revision: number): void => {
370
+ const tracker = identityEstablishRef.current;
371
+ if (tracker.inFlight || tracker.revision === revision) {
372
+ return;
373
+ }
374
+ tracker.revision = revision;
375
+ tracker.inFlight = true;
376
+ void (async () => {
377
+ const established = await establishIdentitySession({
378
+ oxy: oxyServices,
379
+ store: authStore,
380
+ binding: binding.binding,
381
+ });
382
+ if (!established) {
383
+ return;
384
+ }
385
+ // The verify wrote a fresh pin; adopt it before re-reading device state
386
+ // so the notify that follows projects against the new binding.
387
+ await binding.refreshPinnedAccountId();
388
+ await sessionClient.bootstrap();
389
+ })()
390
+ .catch((establishError) => {
391
+ logger('Failed to re-establish the identity-bound session', establishError);
392
+ })
393
+ .finally(() => {
394
+ tracker.inFlight = false;
395
+ });
396
+ },
397
+ [oxyServices, authStore, sessionClient, logger],
398
+ );
399
+
316
400
  // Projects `client.getState()` onto the exposed `sessions`/`activeSessionId`/
317
401
  // `user`. Sole authority for both locally-initiated mutations (switch/logout)
318
402
  // AND remotely-pushed `session_state` over the `device:<deviceId>` socket.
@@ -334,6 +418,13 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
334
418
  // Last-write-wins guard: capture the revision this projection is for, then
335
419
  // after the async profile fetch bail if a fresher state has landed.
336
420
  const capturedRevision = state.revision;
421
+ // Resolve the pin BEFORE the profile fetch (memoised: one storage + keychain
422
+ // read per boot) so every projection below is bound on the FIRST pass over a
423
+ // freshly applied state. Deferring it would let a sibling app's switch render
424
+ // once as this client's user before the pin corrected it. `null` for every
425
+ // account-mode provider, where each projection falls back to the device's
426
+ // active account exactly as before.
427
+ const pinnedAccountId = identity ? await identity.ensurePinnedAccountId() : null;
337
428
  const ids = accountIdsOf(state);
338
429
  let users: User[] = [];
339
430
  try {
@@ -346,16 +437,29 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
346
437
  if (!latest || latest.revision !== capturedRevision) {
347
438
  return;
348
439
  }
440
+ if (identity && (pinnedAccountId === null || activeSessionIdOf(latest, pinnedAccountId) === null)) {
441
+ // Either no verified pin, or the pinned account left this device's session
442
+ // set. Projecting anything here would mean projecting SOMEBODY ELSE's
443
+ // account, so leave the current projection untouched and re-derive the
444
+ // session from the local identity key instead.
445
+ reestablishIdentitySession(identity, latest.revision);
446
+ return;
447
+ }
349
448
  const usersById = new Map(users.map((resolvedUser) => [resolvedUser.id, resolvedUser]));
350
- updateSessions(deviceStateToClientSessions(latest, usersById));
351
- setActiveSessionId(activeSessionIdOf(latest));
352
- const activeUser = activeUserOf(latest, usersById);
449
+ updateSessions(deviceStateToClientSessions(latest, usersById, pinnedAccountId));
450
+ setActiveSessionId(activeSessionIdOf(latest, pinnedAccountId));
451
+ const activeUser = activeUserOf(latest, usersById, pinnedAccountId);
353
452
  if (activeUser) {
354
453
  loginSuccess(activeUser);
355
454
  }
356
- sessionClientHost.setCurrentAccountId(latest.activeAccountId);
455
+ // The host's current account feeds the socket handshake and the bearer's
456
+ // token-account comparisons, so it tracks the PIN — never the account another
457
+ // app switched the device to.
458
+ sessionClientHost.setCurrentAccountId(pinnedAccountId ?? latest.activeAccountId);
357
459
  }, [
460
+ identity,
358
461
  oxyServices,
462
+ reestablishIdentitySession,
359
463
  sessionClient,
360
464
  sessionClientHost,
361
465
  updateSessions,
@@ -483,14 +587,21 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
483
587
  // credential via `POST /session/device/token`) plus the proactive scheduler
484
588
  // that refreshes ~60s before expiry and on tab-focus. Replaces the deleted
485
589
  // services-local `inSessionTokenRefresh` module.
590
+ // An identity binding turns every re-mint pinned: it targets the pinned
591
+ // account instead of the device's active one, and its recovery arm becomes the
592
+ // PRIMARY-key identity sign-in rather than the cross-app shared keychain.
486
593
  useEffect(() => {
487
- const dispose = installAuthRefreshHandler({ oxy: oxyServices, store: authStore });
594
+ const dispose = installAuthRefreshHandler({
595
+ oxy: oxyServices,
596
+ store: authStore,
597
+ ...(identity ? { identity: identity.binding } : {}),
598
+ });
488
599
  const scheduler = startTokenRefreshScheduler(oxyServices);
489
600
  return () => {
490
601
  scheduler.dispose();
491
602
  dispose();
492
603
  };
493
- }, [oxyServices, authStore]);
604
+ }, [oxyServices, authStore, identity]);
494
605
 
495
606
  // ── Session commit funnel ────────────────────────────────────────────────
496
607
  // The single place a session becomes committed: plant tokens, persist the
@@ -571,21 +682,20 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
571
682
  markAuthResolved: markAuthResolvedRef.current,
572
683
  });
573
684
 
574
- if (options.activate && options.hubSync && hubSync && isWebBrowser()) {
575
- try {
576
- await syncHubAfterSignIn(oxyServices, { enabled: hubSync });
577
- } catch (hubError) {
578
- if (__DEV__) {
579
- loggerUtil.debug(
580
- 'Hub sync after sign-in failed (non-fatal)',
581
- { component: 'OxyContext', method: 'commitSession' },
582
- hubError as unknown,
583
- );
584
- }
585
- }
586
- }
685
+ // Post-sign-in hub sync a full-page redirect to auth.oxy.so. Gated HERE,
686
+ // inside the ONE commit funnel, so NO commit path (QR device flow,
687
+ // password/2FA through the account dialog, passkey, popup OAuth, cold
688
+ // boot) can bounce a `webAuthMode: 'popup'` tab to the IdP. See
689
+ // `maybeSyncHubAfterCommit` for the full gate list.
690
+ await maybeSyncHubAfterCommit({
691
+ activate: options.activate,
692
+ hubSyncRequested: options.hubSync === true,
693
+ hubSyncEnabled: hubSync,
694
+ webAuthMode,
695
+ syncHub: () => syncHubAfterSignIn(oxyServices, { enabled: hubSync }),
696
+ });
587
697
  },
588
- [oxyServices, authStore, updateSessions, setActiveSessionId, sessionClient, sessionClientHost, syncFromClient, loginSuccess, logger, hubSync],
698
+ [oxyServices, authStore, updateSessions, setActiveSessionId, sessionClient, sessionClientHost, syncFromClient, loginSuccess, logger, hubSync, webAuthMode],
589
699
  );
590
700
  const commitSessionRef = useRef(commitSession);
591
701
  commitSessionRef.current = commitSession;
@@ -638,6 +748,33 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
638
748
  [commitSession],
639
749
  );
640
750
 
751
+ // ── Web third-party OAuth sign-in ──────────────────────────────────────────
752
+ // The shared operation `OxySignInButton` (and any RP-owned button) delegates
753
+ // to, so no consumer ever writes popup listeners or a token exchange. The
754
+ // transport picks popup vs redirect from `webAuthMode`; both lanes land on the
755
+ // SAME completion path (`completeOAuthCode`) and the same commit funnel here.
756
+ //
757
+ // `hubSync: false` is deliberate: hub sync is a full-page redirect to
758
+ // auth.oxy.so, which would undo the one thing popup mode exists to guarantee —
759
+ // that the relying party never leaves its route. It matches how the redirect
760
+ // lane's return leg commits (see `runProviderColdBoot`).
761
+ const startWebOAuthSignInForContext = useCallback(
762
+ (options: StartWebOAuthSignInOptions): Promise<WebOAuthSignInResult> =>
763
+ startWebOAuthSignIn(
764
+ {
765
+ mode: webAuthMode,
766
+ oxyServices,
767
+ clientId,
768
+ authorizeBaseUrl,
769
+ identityBound: isIdentityBound,
770
+ commitSession: (input) =>
771
+ commitSessionRef.current(input, { activate: true, hubSync: false }),
772
+ },
773
+ options,
774
+ ),
775
+ [webAuthMode, oxyServices, clientId, authorizeBaseUrl, isIdentityBound],
776
+ );
777
+
641
778
  // ── Unified account dialog ─────────────────────────────────────────────────
642
779
  // The single account-chooser + sign-in surface. Built ONCE per provider mount
643
780
  // and bound to the live `oxyServices` + `sessionClient` + this provider's
@@ -679,8 +816,13 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
679
816
  accountDialogSurfaceRef.current?.dismiss();
680
817
  }, []);
681
818
 
819
+ // Never built while identity-bound: the dialog exists to CHOOSE an account,
820
+ // and an identity-bound client has exactly one — the owner of the local
821
+ // identity key. Leaving it `null` (the same shape consumers see with no
822
+ // provider mounted) keeps its QR/polling machinery off entirely instead of
823
+ // relying on UI-level filtering to hide it.
682
824
  const accountDialogControllerRef = useRef<AccountDialogController | null>(null);
683
- if (!accountDialogControllerRef.current) {
825
+ if (!isIdentityBound && !accountDialogControllerRef.current) {
684
826
  accountDialogControllerRef.current = createAccountDialogController({
685
827
  oxyServices,
686
828
  sessionClient,
@@ -714,11 +856,27 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
714
856
  // popup concept there, and off-origin passkey sign-in isn't reachable
715
857
  // (Commons owns the native flow).
716
858
  openPopup: isWebBrowser() ? openPasskeyHubPopup : undefined,
859
+ // Which surface a sign-in starts from — a FACT only this consumer can
860
+ // supply (headless core never touches a platform global). It decides
861
+ // whether automatic delivery may take the same-device Commons deep link;
862
+ // without it the controller stays `'unknown'` and that route never fires.
863
+ platform: resolveDeliveryPlatform(),
717
864
  });
718
865
  }
719
866
  const accountDialogController = accountDialogControllerRef.current;
720
867
 
721
868
  const openAccountDialog = useCallback((view?: AccountDialogView): void => {
869
+ if (isIdentityBound) {
870
+ // No controller was built, and there is nothing to choose: this app's user
871
+ // is fixed to the owner of the local identity key.
872
+ if (__DEV__) {
873
+ loggerUtil.warn(
874
+ 'openAccountDialog ignored: the session is identity-bound (sessionMode: "identity")',
875
+ { component: 'OxyContext', method: 'openAccountDialog' },
876
+ );
877
+ }
878
+ return;
879
+ }
722
880
  const nextView = view ?? 'accounts';
723
881
  accountDialogControllerRef.current?.setView(nextView);
724
882
 
@@ -762,7 +920,7 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
762
920
  }
763
921
  });
764
922
  setAccountDialogOpen(true);
765
- }, []);
923
+ }, [isIdentityBound]);
766
924
 
767
925
  const closeAccountDialog = useCallback((): void => {
768
926
  accountDialogControllerRef.current?.cancelSignIn();
@@ -867,24 +1025,46 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
867
1025
  // ── Cold boot ────────────────────────────────────────────────────────────
868
1026
  // Device-first session restore via `runProviderColdBoot` (see boot/runProviderColdBoot.ts).
869
1027
  const runColdBoot = useCallback(async (): Promise<void> => {
1028
+ // Resolve the pin BEFORE any boot lane runs: `getPinnedAccountId()` is a
1029
+ // SYNCHRONOUS read on `SessionClient`'s apply path, and a stale `null` there
1030
+ // would let a pinned client behave like an account-mode one for the first
1031
+ // state it applies (including re-electing the device's active account).
1032
+ if (identity) {
1033
+ await identity.ensurePinnedAccountId();
1034
+ }
870
1035
  await runProviderColdBoot({
871
1036
  oxyServices,
872
1037
  authStore,
873
1038
  clientId: clientIdProp,
874
1039
  authRedirectUri,
875
1040
  authorizeBaseUrl,
1041
+ sessionMode,
1042
+ identity: identity?.binding,
1043
+ // Popup mode forbids the boot's automatic full-page `prompt=none` restore:
1044
+ // a domain with no local credential resolves signed out instead of
1045
+ // navigating the tab to the IdP (see `allowsAutomaticIdpRedirect`).
1046
+ webAuthMode,
876
1047
  sessionClient,
877
1048
  syncDeviceCredentialToHost,
878
1049
  commitSession: (input, options) => commitSessionRef.current(input, options),
879
1050
  markAuthResolved: () => markAuthResolvedRef.current(),
880
1051
  setTokenReady,
881
1052
  });
1053
+ // The boot may have (re-)established the identity session or cleared a pin
1054
+ // whose key no longer exists, so re-resolve rather than trusting the memo
1055
+ // taken before it ran.
1056
+ if (identity) {
1057
+ await identity.refreshPinnedAccountId();
1058
+ }
882
1059
  }, [
883
1060
  oxyServices,
884
1061
  authStore,
885
1062
  clientIdProp,
886
1063
  authRedirectUri,
887
1064
  authorizeBaseUrl,
1065
+ sessionMode,
1066
+ identity,
1067
+ webAuthMode,
888
1068
  syncDeviceCredentialToHost,
889
1069
  sessionClient,
890
1070
  ]);
@@ -974,8 +1154,14 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
974
1154
  // Exposed `switchSession`: route through the server-authoritative
975
1155
  // `SessionClient`. Resolve the target account from the current device state,
976
1156
  // ask the server to switch, reproject, and return the now-active user.
1157
+ //
1158
+ // Identity-bound providers reject: this is the session-keyed twin of
1159
+ // `switchToAccount`, so leaving it live would be a bypass around the same rule.
977
1160
  const switchSessionForContext = useCallback(
978
1161
  async (sessionId: string): Promise<User> => {
1162
+ if (isIdentityBound) {
1163
+ throw new IdentityBoundSessionError('switchSession');
1164
+ }
979
1165
  const targetAccountId = sessionClient
980
1166
  .getState()
981
1167
  ?.accounts.find((account) => account.sessionId === sessionId)?.accountId;
@@ -990,7 +1176,7 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
990
1176
  }
991
1177
  return activeUser;
992
1178
  },
993
- [sessionClient, syncFromClient],
1179
+ [isIdentityBound, sessionClient, syncFromClient],
994
1180
  );
995
1181
 
996
1182
  // Thin passthroughs to the platform-agnostic KeyManager. NOTE: both now THROW
@@ -1021,6 +1207,7 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
1021
1207
  isAuthenticated,
1022
1208
  tokenReady,
1023
1209
  initialized,
1210
+ identityBound: isIdentityBound,
1024
1211
  oxyServices,
1025
1212
  sessionClient,
1026
1213
  syncFromClient,
@@ -1046,6 +1233,8 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
1046
1233
  isPrivateApiPending,
1047
1234
  isAuthResolved: authResolved,
1048
1235
  isStorageReady: storage !== null,
1236
+ sessionMode: isIdentityBound ? 'identity' : 'account',
1237
+ webAuthMode,
1049
1238
  error,
1050
1239
  currentLanguage,
1051
1240
  currentLanguages,
@@ -1061,6 +1250,7 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
1061
1250
  removePasskey,
1062
1251
  revokeSuspiciousSignIn,
1063
1252
  handleWebSession,
1253
+ startWebOAuthSignIn: startWebOAuthSignInForContext,
1064
1254
  logout,
1065
1255
  logoutAll,
1066
1256
  switchSession: switchSessionForContext,
@@ -1100,6 +1290,8 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
1100
1290
  isPrivateApiPending,
1101
1291
  authResolved,
1102
1292
  storage,
1293
+ isIdentityBound,
1294
+ webAuthMode,
1103
1295
  error,
1104
1296
  currentLanguage,
1105
1297
  currentLanguages,
@@ -1115,6 +1307,7 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
1115
1307
  removePasskey,
1116
1308
  revokeSuspiciousSignIn,
1117
1309
  handleWebSession,
1310
+ startWebOAuthSignInForContext,
1118
1311
  logout,
1119
1312
  logoutAll,
1120
1313
  switchSessionForContext,
@@ -1172,6 +1365,8 @@ const LOADING_STATE: OxyContextState = {
1172
1365
  isPrivateApiPending: true,
1173
1366
  isAuthResolved: false,
1174
1367
  isStorageReady: false,
1368
+ sessionMode: 'account',
1369
+ webAuthMode: 'redirect',
1175
1370
  error: null,
1176
1371
  currentLanguage: 'en-US',
1177
1372
  currentLanguages: [],
@@ -1187,6 +1382,7 @@ const LOADING_STATE: OxyContextState = {
1187
1382
  removePasskey: () => rejectMissingProvider<void>(),
1188
1383
  revokeSuspiciousSignIn: () => rejectMissingProvider<void>(),
1189
1384
  handleWebSession: () => rejectMissingProvider<void>(),
1385
+ startWebOAuthSignIn: () => rejectMissingProvider<WebOAuthSignInResult>(),
1190
1386
  logout: () => rejectMissingProvider<void>(),
1191
1387
  logoutAll: () => rejectMissingProvider<void>(),
1192
1388
  switchSession: () => rejectMissingProvider<User>(),
@@ -1,8 +1,11 @@
1
1
  import type { User } from '@oxyhq/core';
2
2
  import { logger } from '@oxyhq/core';
3
+ import type { WebAuthMode } from '../../oauth/types';
3
4
  import {
4
5
  commitDeviceSetAndResolve,
6
+ maybeSyncHubAfterCommit,
5
7
  type CommitDeviceSetAndResolveDeps,
8
+ type MaybeSyncHubAfterCommitDeps,
6
9
  } from '../commitSessionFlow';
7
10
 
8
11
  // A resolved promise chain (addCurrentAccount -> start -> syncFromClient) settles
@@ -178,6 +181,92 @@ describe('commitDeviceSetAndResolve — cold boot (activate: false)', () => {
178
181
  });
179
182
  });
180
183
 
184
+ /**
185
+ * Post-sign-in hub sync is a FULL-PAGE redirect to auth.oxy.so. It runs from the
186
+ * ONE commit funnel, so gating it here gates every commit path at once —
187
+ * `webAuthMode: 'popup'` must never bounce the tab, whichever path signed the
188
+ * user in (#691 phase 7).
189
+ */
190
+ describe('maybeSyncHubAfterCommit — webAuthMode transport gate (#691 phase 7)', () => {
191
+ const buildHubDeps = (
192
+ overrides: Partial<MaybeSyncHubAfterCommitDeps> = {},
193
+ ): MaybeSyncHubAfterCommitDeps => ({
194
+ activate: true,
195
+ hubSyncRequested: true,
196
+ hubSyncEnabled: true,
197
+ webAuthMode: 'redirect',
198
+ syncHub: jest.fn(async () => true),
199
+ ...overrides,
200
+ });
201
+
202
+ it("redirect mode: syncs the hub after a deliberate sign-in (unchanged)", async () => {
203
+ const deps = buildHubDeps();
204
+
205
+ await expect(maybeSyncHubAfterCommit(deps)).resolves.toBe(true);
206
+
207
+ expect(deps.syncHub).toHaveBeenCalledTimes(1);
208
+ });
209
+
210
+ it('popup mode: NEVER syncs the hub, even on an otherwise-eligible sign-in', async () => {
211
+ const deps = buildHubDeps({ webAuthMode: 'popup' });
212
+
213
+ await expect(maybeSyncHubAfterCommit(deps)).resolves.toBe(false);
214
+
215
+ expect(deps.syncHub).not.toHaveBeenCalled();
216
+ });
217
+
218
+ it('popup mode: no commit path can opt back in', async () => {
219
+ // Every commit path differs only in `activate` / `hubSyncRequested`; the
220
+ // transport gate outranks all of them.
221
+ for (const activate of [true, false]) {
222
+ for (const hubSyncRequested of [true, false]) {
223
+ const deps = buildHubDeps({ webAuthMode: 'popup', activate, hubSyncRequested });
224
+ await expect(maybeSyncHubAfterCommit(deps)).resolves.toBe(false);
225
+ expect(deps.syncHub).not.toHaveBeenCalled();
226
+ }
227
+ }
228
+ });
229
+
230
+ it.each(['popup', 'redirect'] as const)(
231
+ 'never syncs on a cold-boot restore, in either mode (%s)',
232
+ async (webAuthMode: WebAuthMode) => {
233
+ const deps = buildHubDeps({ webAuthMode, activate: false });
234
+
235
+ await expect(maybeSyncHubAfterCommit(deps)).resolves.toBe(false);
236
+
237
+ expect(deps.syncHub).not.toHaveBeenCalled();
238
+ },
239
+ );
240
+
241
+ it('redirect mode: honours the per-commit opt-out (account switch / popup OAuth lanes)', async () => {
242
+ const deps = buildHubDeps({ hubSyncRequested: false });
243
+
244
+ await expect(maybeSyncHubAfterCommit(deps)).resolves.toBe(false);
245
+
246
+ expect(deps.syncHub).not.toHaveBeenCalled();
247
+ });
248
+
249
+ it('redirect mode: honours the provider-level hubSync opt-out', async () => {
250
+ const deps = buildHubDeps({ hubSyncEnabled: false });
251
+
252
+ await expect(maybeSyncHubAfterCommit(deps)).resolves.toBe(false);
253
+
254
+ expect(deps.syncHub).not.toHaveBeenCalled();
255
+ });
256
+
257
+ it('redirect mode: a failing hub sync is non-fatal and never rejects', async () => {
258
+ const deps = buildHubDeps({
259
+ syncHub: jest.fn(async () => {
260
+ throw new Error('hub ticket failed');
261
+ }),
262
+ });
263
+
264
+ await expect(maybeSyncHubAfterCommit(deps)).resolves.toBe(false);
265
+
266
+ expect(deps.syncHub).toHaveBeenCalledTimes(1);
267
+ });
268
+ });
269
+
181
270
  describe('commitDeviceSetAndResolve — deliberate sign-in (activate: true)', () => {
182
271
  it('BLOCKS on the device-set reconcile before resolving auth (unchanged ordering)', async () => {
183
272
  const order: string[] = [];
@@ -1,5 +1,8 @@
1
1
  import type { User } from '@oxyhq/core';
2
2
  import { logger as loggerUtil } from '@oxyhq/core';
3
+ import { allowsAutomaticIdpRedirect } from '../oauth/legacyRedirectLanes';
4
+ import type { WebAuthMode } from '../oauth/types';
5
+ import { isWebBrowser } from '../utils/isWebBrowser';
3
6
  import { isUnauthorizedStatus } from './oxyContextHelpers';
4
7
 
5
8
  const LOG_CONTEXT = { component: 'OxyContext', method: 'commitSession' } as const;
@@ -123,3 +126,61 @@ export async function commitDeviceSetAndResolve(
123
126
  await hydrateAndResolve();
124
127
  void reconcileDeviceSet().catch(logReconcileError);
125
128
  }
129
+
130
+ export interface MaybeSyncHubAfterCommitDeps {
131
+ /** Deliberate sign-in (`true`) vs. a cold-boot / background commit (`false`). */
132
+ activate: boolean;
133
+ /** Per-commit opt-in — `commitSession`'s `options.hubSync`. */
134
+ hubSyncRequested: boolean;
135
+ /** Provider-level opt-out — `OxyProviderProps.hubSync`. */
136
+ hubSyncEnabled: boolean;
137
+ /**
138
+ * The provider's web sign-in transport — `OxyProviderProps.webAuthMode`.
139
+ * A first-class input: `'popup'` forbids the redirect outright.
140
+ */
141
+ webAuthMode: WebAuthMode;
142
+ /**
143
+ * Starts the full-page hop to `auth.oxy.so/sync`; resolves `true` when the
144
+ * navigation was actually started.
145
+ */
146
+ syncHub: () => Promise<boolean>;
147
+ }
148
+
149
+ /**
150
+ * Post-sign-in hub sync: plant this device's credential on the IdP hub so OTHER
151
+ * official origins can silently restore a session on their next cold boot.
152
+ *
153
+ * The tail of the ONE commit funnel (`commitSession`), extracted so every gate
154
+ * on this legacy lane lives — and is tested — in one place. Returns whether the
155
+ * full-page redirect was started; a failure is non-fatal and never propagates
156
+ * (the sign-in itself already succeeded).
157
+ *
158
+ * Four gates, all of which must pass:
159
+ * 1. `activate` — only a deliberate sign-in syncs; a cold-boot restore never does.
160
+ * 2. `hubSyncRequested` — the in-place lanes (account switch, popup OAuth) opt out.
161
+ * 3. `hubSyncEnabled` — the provider-level `hubSync` prop.
162
+ * 4. `allowsAutomaticIdpRedirect(webAuthMode)` — hub sync REPLACES the document
163
+ * with `auth.oxy.so`, so `webAuthMode: 'popup'` forbids it: a redirect that
164
+ * bounces the tab defeats the entire point of the mode, no matter which
165
+ * commit path produced the session (issue #691, "Cold boot and cross-domain
166
+ * behavior"). Redirect mode — the default and the compatibility path — is
167
+ * unchanged, and this whole function disappears with it in phase 7b.
168
+ */
169
+ export async function maybeSyncHubAfterCommit(
170
+ deps: MaybeSyncHubAfterCommitDeps,
171
+ ): Promise<boolean> {
172
+ const { activate, hubSyncRequested, hubSyncEnabled, webAuthMode, syncHub } = deps;
173
+
174
+ if (!activate || !hubSyncRequested || !hubSyncEnabled) return false;
175
+ if (!allowsAutomaticIdpRedirect(webAuthMode)) return false;
176
+ if (!isWebBrowser()) return false;
177
+
178
+ try {
179
+ return await syncHub();
180
+ } catch (hubError) {
181
+ if (__DEV__) {
182
+ loggerUtil.debug('Hub sync after sign-in failed (non-fatal)', LOG_CONTEXT, hubError);
183
+ }
184
+ return false;
185
+ }
186
+ }