@oxy.so/services 4.0.7 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (326) hide show
  1. package/README.md +1 -1
  2. package/lib/commonjs/assets/assets/signIn/slide-1.jpg +0 -0
  3. package/lib/commonjs/assets/assets/signIn/slide-1.jpg.d.ts +3 -0
  4. package/lib/commonjs/assets/assets/signIn/slide-2.jpg +0 -0
  5. package/lib/commonjs/assets/assets/signIn/slide-2.jpg.d.ts +3 -0
  6. package/lib/commonjs/assets/assets/signIn/slide-3.jpg +0 -0
  7. package/lib/commonjs/assets/assets/signIn/slide-3.jpg.d.ts +3 -0
  8. package/lib/commonjs/assets/assets/signIn/slide-4.jpg +0 -0
  9. package/lib/commonjs/assets/assets/signIn/slide-4.jpg.d.ts +3 -0
  10. package/lib/commonjs/assets/signIn/slide-1.jpg +0 -0
  11. package/lib/commonjs/assets/signIn/slide-2.jpg +0 -0
  12. package/lib/commonjs/assets/signIn/slide-3.jpg +0 -0
  13. package/lib/commonjs/assets/signIn/slide-4.jpg +0 -0
  14. package/lib/commonjs/index.js +45 -8
  15. package/lib/commonjs/index.js.map +1 -1
  16. package/lib/commonjs/ui/components/OxyAccountDialogScreen.js +11 -58
  17. package/lib/commonjs/ui/components/OxyAccountDialogScreen.js.map +1 -1
  18. package/lib/commonjs/ui/components/OxyAuthChooser.js +36 -44
  19. package/lib/commonjs/ui/components/OxyAuthChooser.js.map +1 -1
  20. package/lib/commonjs/ui/components/OxyProvider.js +0 -2
  21. package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
  22. package/lib/commonjs/ui/components/ProfileButton.js.map +1 -1
  23. package/lib/commonjs/ui/components/authChooser/AccountsMenuView.js +29 -8
  24. package/lib/commonjs/ui/components/authChooser/AccountsMenuView.js.map +1 -1
  25. package/lib/commonjs/ui/components/authChooser/primitives.js +7 -52
  26. package/lib/commonjs/ui/components/authChooser/primitives.js.map +1 -1
  27. package/lib/commonjs/ui/components/authChooser/signInFailureMessage.js +1 -7
  28. package/lib/commonjs/ui/components/authChooser/signInFailureMessage.js.map +1 -1
  29. package/lib/commonjs/ui/components/authChooser/styles.js +0 -31
  30. package/lib/commonjs/ui/components/authChooser/styles.js.map +1 -1
  31. package/lib/commonjs/ui/components/authChooser/types.js +2 -2
  32. package/lib/commonjs/ui/components/oauthNavigation.js +1 -1
  33. package/lib/commonjs/ui/components/signIn/InlineCommonsQr.js +161 -0
  34. package/lib/commonjs/ui/components/signIn/InlineCommonsQr.js.map +1 -0
  35. package/lib/commonjs/ui/components/signIn/OxyAccountPicker.js +111 -0
  36. package/lib/commonjs/ui/components/signIn/OxyAccountPicker.js.map +1 -0
  37. package/lib/commonjs/ui/components/signIn/OxyAuthScreen.js +160 -0
  38. package/lib/commonjs/ui/components/signIn/OxyAuthScreen.js.map +1 -0
  39. package/lib/commonjs/ui/components/signIn/OxySignInPanel.js +371 -0
  40. package/lib/commonjs/ui/components/signIn/OxySignInPanel.js.map +1 -0
  41. package/lib/commonjs/ui/components/signIn/OxySignUpPanel.js +78 -0
  42. package/lib/commonjs/ui/components/signIn/OxySignUpPanel.js.map +1 -0
  43. package/lib/commonjs/ui/components/signIn/artwork.js +21 -0
  44. package/lib/commonjs/ui/components/signIn/artwork.js.map +1 -0
  45. package/lib/commonjs/ui/components/signIn/passkeyError.js +46 -0
  46. package/lib/commonjs/ui/components/signIn/passkeyError.js.map +1 -0
  47. package/lib/commonjs/ui/components/signIn/signInMethods.js +46 -0
  48. package/lib/commonjs/ui/components/signIn/signInMethods.js.map +1 -0
  49. package/lib/commonjs/ui/context/OxyContext.js +16 -16
  50. package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
  51. package/lib/commonjs/ui/context/commitSessionFlow.js +0 -43
  52. package/lib/commonjs/ui/context/commitSessionFlow.js.map +1 -1
  53. package/lib/commonjs/ui/hooks/accountDialogSnapshot.js +15 -1
  54. package/lib/commonjs/ui/hooks/accountDialogSnapshot.js.map +1 -1
  55. package/lib/commonjs/ui/hooks/useDeviceSwitcher.js +1 -3
  56. package/lib/commonjs/ui/hooks/useDeviceSwitcher.js.map +1 -1
  57. package/lib/commonjs/ui/oauth/browserAuthTransport.js +11 -4
  58. package/lib/commonjs/ui/oauth/browserAuthTransport.js.map +1 -1
  59. package/lib/commonjs/ui/oauth/oauthHandshake.js +3 -0
  60. package/lib/commonjs/ui/oauth/oauthHandshake.js.map +1 -1
  61. package/lib/commonjs/ui/oauth/oauthPopup.js +2 -3
  62. package/lib/commonjs/ui/oauth/oauthPopup.js.map +1 -1
  63. package/lib/commonjs/ui/screens/ManageAccountScreen.js +2 -3
  64. package/lib/commonjs/ui/screens/ManageAccountScreen.js.map +1 -1
  65. package/lib/commonjs/ui/screens/trust/TrustLeaderboardScreen.js +1 -1
  66. package/lib/commonjs/ui/screens/trust/TrustLeaderboardScreen.js.map +1 -1
  67. package/lib/commonjs/ui/session/authStore.js +0 -21
  68. package/lib/commonjs/ui/session/authStore.js.map +1 -1
  69. package/lib/commonjs/ui/utils/accountDeletionHandoff.js +1 -1
  70. package/lib/commonjs/ui/utils/accountDeletionHandoff.js.map +1 -1
  71. package/lib/module/assets/assets/signIn/slide-1.jpg +0 -0
  72. package/lib/module/assets/assets/signIn/slide-1.jpg.d.ts +3 -0
  73. package/lib/module/assets/assets/signIn/slide-2.jpg +0 -0
  74. package/lib/module/assets/assets/signIn/slide-2.jpg.d.ts +3 -0
  75. package/lib/module/assets/assets/signIn/slide-3.jpg +0 -0
  76. package/lib/module/assets/assets/signIn/slide-3.jpg.d.ts +3 -0
  77. package/lib/module/assets/assets/signIn/slide-4.jpg +0 -0
  78. package/lib/module/assets/assets/signIn/slide-4.jpg.d.ts +3 -0
  79. package/lib/module/assets/signIn/slide-1.jpg +0 -0
  80. package/lib/module/assets/signIn/slide-2.jpg +0 -0
  81. package/lib/module/assets/signIn/slide-3.jpg +0 -0
  82. package/lib/module/assets/signIn/slide-4.jpg +0 -0
  83. package/lib/module/index.js +7 -6
  84. package/lib/module/index.js.map +1 -1
  85. package/lib/module/ui/components/OxyAccountDialogScreen.js +14 -59
  86. package/lib/module/ui/components/OxyAccountDialogScreen.js.map +1 -1
  87. package/lib/module/ui/components/OxyAuthChooser.js +37 -45
  88. package/lib/module/ui/components/OxyAuthChooser.js.map +1 -1
  89. package/lib/module/ui/components/OxyProvider.js +0 -2
  90. package/lib/module/ui/components/OxyProvider.js.map +1 -1
  91. package/lib/module/ui/components/ProfileButton.js.map +1 -1
  92. package/lib/module/ui/components/authChooser/AccountsMenuView.js +21 -2
  93. package/lib/module/ui/components/authChooser/AccountsMenuView.js.map +1 -1
  94. package/lib/module/ui/components/authChooser/primitives.js +1 -44
  95. package/lib/module/ui/components/authChooser/primitives.js.map +1 -1
  96. package/lib/module/ui/components/authChooser/signInFailureMessage.js +1 -7
  97. package/lib/module/ui/components/authChooser/signInFailureMessage.js.map +1 -1
  98. package/lib/module/ui/components/authChooser/styles.js +0 -31
  99. package/lib/module/ui/components/authChooser/styles.js.map +1 -1
  100. package/lib/module/ui/components/authChooser/types.js +2 -2
  101. package/lib/module/ui/components/oauthNavigation.js +1 -1
  102. package/lib/module/ui/components/signIn/InlineCommonsQr.js +157 -0
  103. package/lib/module/ui/components/signIn/InlineCommonsQr.js.map +1 -0
  104. package/lib/module/ui/components/signIn/OxyAccountPicker.js +106 -0
  105. package/lib/module/ui/components/signIn/OxyAccountPicker.js.map +1 -0
  106. package/lib/module/ui/components/signIn/OxyAuthScreen.js +151 -0
  107. package/lib/module/ui/components/signIn/OxyAuthScreen.js.map +1 -0
  108. package/lib/module/ui/components/signIn/OxySignInPanel.js +366 -0
  109. package/lib/module/ui/components/signIn/OxySignInPanel.js.map +1 -0
  110. package/lib/module/ui/components/signIn/OxySignUpPanel.js +75 -0
  111. package/lib/module/ui/components/signIn/OxySignUpPanel.js.map +1 -0
  112. package/lib/module/ui/components/signIn/artwork.js +16 -0
  113. package/lib/module/ui/components/signIn/artwork.js.map +1 -0
  114. package/lib/module/ui/components/signIn/passkeyError.js +40 -0
  115. package/lib/module/ui/components/signIn/passkeyError.js.map +1 -0
  116. package/lib/module/ui/components/signIn/signInMethods.js +42 -0
  117. package/lib/module/ui/components/signIn/signInMethods.js.map +1 -0
  118. package/lib/module/ui/context/OxyContext.js +17 -17
  119. package/lib/module/ui/context/OxyContext.js.map +1 -1
  120. package/lib/module/ui/context/commitSessionFlow.js +0 -42
  121. package/lib/module/ui/context/commitSessionFlow.js.map +1 -1
  122. package/lib/module/ui/hooks/accountDialogSnapshot.js +14 -1
  123. package/lib/module/ui/hooks/accountDialogSnapshot.js.map +1 -1
  124. package/lib/module/ui/hooks/useDeviceSwitcher.js +3 -5
  125. package/lib/module/ui/hooks/useDeviceSwitcher.js.map +1 -1
  126. package/lib/module/ui/oauth/browserAuthTransport.js +11 -4
  127. package/lib/module/ui/oauth/browserAuthTransport.js.map +1 -1
  128. package/lib/module/ui/oauth/oauthHandshake.js +3 -0
  129. package/lib/module/ui/oauth/oauthHandshake.js.map +1 -1
  130. package/lib/module/ui/oauth/oauthPopup.js +2 -3
  131. package/lib/module/ui/oauth/oauthPopup.js.map +1 -1
  132. package/lib/module/ui/screens/ManageAccountScreen.js +3 -4
  133. package/lib/module/ui/screens/ManageAccountScreen.js.map +1 -1
  134. package/lib/module/ui/screens/trust/TrustLeaderboardScreen.js +1 -1
  135. package/lib/module/ui/screens/trust/TrustLeaderboardScreen.js.map +1 -1
  136. package/lib/module/ui/session/authStore.js +1 -22
  137. package/lib/module/ui/session/authStore.js.map +1 -1
  138. package/lib/module/ui/utils/accountDeletionHandoff.js +2 -2
  139. package/lib/module/ui/utils/accountDeletionHandoff.js.map +1 -1
  140. package/lib/typescript/assets/signIn/slide-1.jpg.d.ts +3 -0
  141. package/lib/typescript/assets/signIn/slide-2.jpg.d.ts +3 -0
  142. package/lib/typescript/assets/signIn/slide-3.jpg.d.ts +3 -0
  143. package/lib/typescript/assets/signIn/slide-4.jpg.d.ts +3 -0
  144. package/lib/typescript/commonjs/index.d.ts +8 -2
  145. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  146. package/lib/typescript/commonjs/ui/components/OxyAccountDialogScreen.d.ts.map +1 -1
  147. package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts +5 -12
  148. package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts.map +1 -1
  149. package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts.map +1 -1
  150. package/lib/typescript/commonjs/ui/components/ProfileButton.d.ts +1 -1
  151. package/lib/typescript/commonjs/ui/components/ProfileButton.d.ts.map +1 -1
  152. package/lib/typescript/commonjs/ui/components/authChooser/AccountsMenuView.d.ts.map +1 -1
  153. package/lib/typescript/commonjs/ui/components/authChooser/primitives.d.ts +0 -19
  154. package/lib/typescript/commonjs/ui/components/authChooser/primitives.d.ts.map +1 -1
  155. package/lib/typescript/commonjs/ui/components/authChooser/signInFailureMessage.d.ts +1 -5
  156. package/lib/typescript/commonjs/ui/components/authChooser/signInFailureMessage.d.ts.map +1 -1
  157. package/lib/typescript/commonjs/ui/components/authChooser/styles.d.ts +0 -31
  158. package/lib/typescript/commonjs/ui/components/authChooser/styles.d.ts.map +1 -1
  159. package/lib/typescript/commonjs/ui/components/authChooser/types.d.ts +3 -3
  160. package/lib/typescript/commonjs/ui/components/oauthNavigation.d.ts +1 -1
  161. package/lib/typescript/commonjs/ui/components/signIn/InlineCommonsQr.d.ts +20 -0
  162. package/lib/typescript/commonjs/ui/components/signIn/InlineCommonsQr.d.ts.map +1 -0
  163. package/lib/typescript/commonjs/ui/components/signIn/OxyAccountPicker.d.ts +34 -0
  164. package/lib/typescript/commonjs/ui/components/signIn/OxyAccountPicker.d.ts.map +1 -0
  165. package/lib/typescript/commonjs/ui/components/signIn/OxyAuthScreen.d.ts +43 -0
  166. package/lib/typescript/commonjs/ui/components/signIn/OxyAuthScreen.d.ts.map +1 -0
  167. package/lib/typescript/commonjs/ui/components/signIn/OxySignInPanel.d.ts +43 -0
  168. package/lib/typescript/commonjs/ui/components/signIn/OxySignInPanel.d.ts.map +1 -0
  169. package/lib/typescript/commonjs/ui/components/signIn/OxySignUpPanel.d.ts +17 -0
  170. package/lib/typescript/commonjs/ui/components/signIn/OxySignUpPanel.d.ts.map +1 -0
  171. package/lib/typescript/commonjs/ui/components/signIn/artwork.d.ts +8 -0
  172. package/lib/typescript/commonjs/ui/components/signIn/artwork.d.ts.map +1 -0
  173. package/lib/typescript/commonjs/ui/components/signIn/passkeyError.d.ts +16 -0
  174. package/lib/typescript/commonjs/ui/components/signIn/passkeyError.d.ts.map +1 -0
  175. package/lib/typescript/commonjs/ui/components/signIn/signInMethods.d.ts +39 -0
  176. package/lib/typescript/commonjs/ui/components/signIn/signInMethods.d.ts.map +1 -0
  177. package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
  178. package/lib/typescript/commonjs/ui/context/commitSessionFlow.d.ts +0 -40
  179. package/lib/typescript/commonjs/ui/context/commitSessionFlow.d.ts.map +1 -1
  180. package/lib/typescript/commonjs/ui/context/oxyContextTypes.d.ts +8 -9
  181. package/lib/typescript/commonjs/ui/context/oxyContextTypes.d.ts.map +1 -1
  182. package/lib/typescript/commonjs/ui/hooks/accountDialogSnapshot.d.ts +7 -1
  183. package/lib/typescript/commonjs/ui/hooks/accountDialogSnapshot.d.ts.map +1 -1
  184. package/lib/typescript/commonjs/ui/hooks/useDeviceSwitcher.d.ts.map +1 -1
  185. package/lib/typescript/commonjs/ui/oauth/browserAuthTransport.d.ts +9 -0
  186. package/lib/typescript/commonjs/ui/oauth/browserAuthTransport.d.ts.map +1 -1
  187. package/lib/typescript/commonjs/ui/oauth/oauthHandshake.d.ts +3 -0
  188. package/lib/typescript/commonjs/ui/oauth/oauthHandshake.d.ts.map +1 -1
  189. package/lib/typescript/commonjs/ui/oauth/oauthPopup.d.ts +2 -3
  190. package/lib/typescript/commonjs/ui/oauth/oauthPopup.d.ts.map +1 -1
  191. package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts.map +1 -1
  192. package/lib/typescript/commonjs/ui/session/authStore.d.ts +0 -30
  193. package/lib/typescript/commonjs/ui/session/authStore.d.ts.map +1 -1
  194. package/lib/typescript/commonjs/ui/types/navigation.d.ts +0 -26
  195. package/lib/typescript/commonjs/ui/types/navigation.d.ts.map +1 -1
  196. package/lib/typescript/module/index.d.ts +8 -2
  197. package/lib/typescript/module/index.d.ts.map +1 -1
  198. package/lib/typescript/module/ui/components/OxyAccountDialogScreen.d.ts.map +1 -1
  199. package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts +5 -12
  200. package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts.map +1 -1
  201. package/lib/typescript/module/ui/components/OxyProvider.d.ts.map +1 -1
  202. package/lib/typescript/module/ui/components/ProfileButton.d.ts +1 -1
  203. package/lib/typescript/module/ui/components/ProfileButton.d.ts.map +1 -1
  204. package/lib/typescript/module/ui/components/authChooser/AccountsMenuView.d.ts.map +1 -1
  205. package/lib/typescript/module/ui/components/authChooser/primitives.d.ts +0 -19
  206. package/lib/typescript/module/ui/components/authChooser/primitives.d.ts.map +1 -1
  207. package/lib/typescript/module/ui/components/authChooser/signInFailureMessage.d.ts +1 -5
  208. package/lib/typescript/module/ui/components/authChooser/signInFailureMessage.d.ts.map +1 -1
  209. package/lib/typescript/module/ui/components/authChooser/styles.d.ts +0 -31
  210. package/lib/typescript/module/ui/components/authChooser/styles.d.ts.map +1 -1
  211. package/lib/typescript/module/ui/components/authChooser/types.d.ts +3 -3
  212. package/lib/typescript/module/ui/components/oauthNavigation.d.ts +1 -1
  213. package/lib/typescript/module/ui/components/signIn/InlineCommonsQr.d.ts +20 -0
  214. package/lib/typescript/module/ui/components/signIn/InlineCommonsQr.d.ts.map +1 -0
  215. package/lib/typescript/module/ui/components/signIn/OxyAccountPicker.d.ts +34 -0
  216. package/lib/typescript/module/ui/components/signIn/OxyAccountPicker.d.ts.map +1 -0
  217. package/lib/typescript/module/ui/components/signIn/OxyAuthScreen.d.ts +43 -0
  218. package/lib/typescript/module/ui/components/signIn/OxyAuthScreen.d.ts.map +1 -0
  219. package/lib/typescript/module/ui/components/signIn/OxySignInPanel.d.ts +43 -0
  220. package/lib/typescript/module/ui/components/signIn/OxySignInPanel.d.ts.map +1 -0
  221. package/lib/typescript/module/ui/components/signIn/OxySignUpPanel.d.ts +17 -0
  222. package/lib/typescript/module/ui/components/signIn/OxySignUpPanel.d.ts.map +1 -0
  223. package/lib/typescript/module/ui/components/signIn/artwork.d.ts +8 -0
  224. package/lib/typescript/module/ui/components/signIn/artwork.d.ts.map +1 -0
  225. package/lib/typescript/module/ui/components/signIn/passkeyError.d.ts +16 -0
  226. package/lib/typescript/module/ui/components/signIn/passkeyError.d.ts.map +1 -0
  227. package/lib/typescript/module/ui/components/signIn/signInMethods.d.ts +39 -0
  228. package/lib/typescript/module/ui/components/signIn/signInMethods.d.ts.map +1 -0
  229. package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
  230. package/lib/typescript/module/ui/context/commitSessionFlow.d.ts +0 -40
  231. package/lib/typescript/module/ui/context/commitSessionFlow.d.ts.map +1 -1
  232. package/lib/typescript/module/ui/context/oxyContextTypes.d.ts +8 -9
  233. package/lib/typescript/module/ui/context/oxyContextTypes.d.ts.map +1 -1
  234. package/lib/typescript/module/ui/hooks/accountDialogSnapshot.d.ts +7 -1
  235. package/lib/typescript/module/ui/hooks/accountDialogSnapshot.d.ts.map +1 -1
  236. package/lib/typescript/module/ui/hooks/useDeviceSwitcher.d.ts.map +1 -1
  237. package/lib/typescript/module/ui/oauth/browserAuthTransport.d.ts +9 -0
  238. package/lib/typescript/module/ui/oauth/browserAuthTransport.d.ts.map +1 -1
  239. package/lib/typescript/module/ui/oauth/oauthHandshake.d.ts +3 -0
  240. package/lib/typescript/module/ui/oauth/oauthHandshake.d.ts.map +1 -1
  241. package/lib/typescript/module/ui/oauth/oauthPopup.d.ts +2 -3
  242. package/lib/typescript/module/ui/oauth/oauthPopup.d.ts.map +1 -1
  243. package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts.map +1 -1
  244. package/lib/typescript/module/ui/session/authStore.d.ts +0 -30
  245. package/lib/typescript/module/ui/session/authStore.d.ts.map +1 -1
  246. package/lib/typescript/module/ui/types/navigation.d.ts +0 -26
  247. package/lib/typescript/module/ui/types/navigation.d.ts.map +1 -1
  248. package/package.json +4 -7
  249. package/src/assets/signIn/slide-1.jpg +0 -0
  250. package/src/assets/signIn/slide-1.jpg.d.ts +3 -0
  251. package/src/assets/signIn/slide-2.jpg +0 -0
  252. package/src/assets/signIn/slide-2.jpg.d.ts +3 -0
  253. package/src/assets/signIn/slide-3.jpg +0 -0
  254. package/src/assets/signIn/slide-3.jpg.d.ts +3 -0
  255. package/src/assets/signIn/slide-4.jpg +0 -0
  256. package/src/assets/signIn/slide-4.jpg.d.ts +3 -0
  257. package/src/index.ts +16 -7
  258. package/src/ui/components/OxyAccountDialogScreen.tsx +11 -72
  259. package/src/ui/components/OxyAuthChooser.tsx +37 -53
  260. package/src/ui/components/OxyProvider.tsx +0 -2
  261. package/src/ui/components/ProfileButton.tsx +1 -4
  262. package/src/ui/components/authChooser/AccountsMenuView.tsx +28 -1
  263. package/src/ui/components/authChooser/primitives.tsx +1 -39
  264. package/src/ui/components/authChooser/signInFailureMessage.ts +1 -7
  265. package/src/ui/components/authChooser/styles.ts +0 -31
  266. package/src/ui/components/authChooser/types.ts +3 -3
  267. package/src/ui/components/oauthNavigation.ts +1 -1
  268. package/src/ui/components/signIn/InlineCommonsQr.tsx +135 -0
  269. package/src/ui/components/signIn/OxyAccountPicker.tsx +129 -0
  270. package/src/ui/components/signIn/OxyAuthScreen.tsx +123 -0
  271. package/src/ui/components/signIn/OxySignInPanel.tsx +392 -0
  272. package/src/ui/components/signIn/OxySignUpPanel.tsx +86 -0
  273. package/src/ui/components/signIn/artwork.ts +13 -0
  274. package/src/ui/components/signIn/passkeyError.ts +44 -0
  275. package/src/ui/components/signIn/signInMethods.ts +51 -0
  276. package/src/ui/context/OxyContext.tsx +21 -18
  277. package/src/ui/context/__tests__/commitSessionFlow.test.ts +0 -89
  278. package/src/ui/context/commitSessionFlow.ts +0 -61
  279. package/src/ui/context/oxyContextTypes.ts +9 -9
  280. package/src/ui/hooks/accountDialogSnapshot.ts +20 -1
  281. package/src/ui/hooks/useDeviceSwitcher.ts +3 -11
  282. package/src/ui/oauth/__tests__/browserAuthTransport.test.ts +21 -0
  283. package/src/ui/oauth/browserAuthTransport.ts +14 -4
  284. package/src/ui/oauth/oauthHandshake.ts +4 -1
  285. package/src/ui/oauth/oauthPopup.ts +2 -3
  286. package/src/ui/screens/ManageAccountScreen.tsx +3 -4
  287. package/src/ui/screens/trust/TrustLeaderboardScreen.tsx +1 -1
  288. package/src/ui/session/authStore.ts +0 -37
  289. package/src/ui/types/navigation.ts +0 -26
  290. package/src/ui/utils/accountDeletionHandoff.ts +2 -2
  291. package/lib/commonjs/ui/components/authChooser/SignInEntryView.js +0 -132
  292. package/lib/commonjs/ui/components/authChooser/SignInEntryView.js.map +0 -1
  293. package/lib/commonjs/ui/components/authChooser/SignUpView.js +0 -77
  294. package/lib/commonjs/ui/components/authChooser/SignUpView.js.map +0 -1
  295. package/lib/commonjs/ui/components/passkeyHubPopup.js +0 -33
  296. package/lib/commonjs/ui/components/passkeyHubPopup.js.map +0 -1
  297. package/lib/commonjs/ui/oauth/legacyRedirectLanes.js +0 -48
  298. package/lib/commonjs/ui/oauth/legacyRedirectLanes.js.map +0 -1
  299. package/lib/module/ui/components/authChooser/SignInEntryView.js +0 -127
  300. package/lib/module/ui/components/authChooser/SignInEntryView.js.map +0 -1
  301. package/lib/module/ui/components/authChooser/SignUpView.js +0 -73
  302. package/lib/module/ui/components/authChooser/SignUpView.js.map +0 -1
  303. package/lib/module/ui/components/passkeyHubPopup.js +0 -29
  304. package/lib/module/ui/components/passkeyHubPopup.js.map +0 -1
  305. package/lib/module/ui/oauth/legacyRedirectLanes.js +0 -44
  306. package/lib/module/ui/oauth/legacyRedirectLanes.js.map +0 -1
  307. package/lib/typescript/commonjs/ui/components/authChooser/SignInEntryView.d.ts +0 -39
  308. package/lib/typescript/commonjs/ui/components/authChooser/SignInEntryView.d.ts.map +0 -1
  309. package/lib/typescript/commonjs/ui/components/authChooser/SignUpView.d.ts +0 -31
  310. package/lib/typescript/commonjs/ui/components/authChooser/SignUpView.d.ts.map +0 -1
  311. package/lib/typescript/commonjs/ui/components/passkeyHubPopup.d.ts +0 -23
  312. package/lib/typescript/commonjs/ui/components/passkeyHubPopup.d.ts.map +0 -1
  313. package/lib/typescript/commonjs/ui/oauth/legacyRedirectLanes.d.ts +0 -40
  314. package/lib/typescript/commonjs/ui/oauth/legacyRedirectLanes.d.ts.map +0 -1
  315. package/lib/typescript/module/ui/components/authChooser/SignInEntryView.d.ts +0 -39
  316. package/lib/typescript/module/ui/components/authChooser/SignInEntryView.d.ts.map +0 -1
  317. package/lib/typescript/module/ui/components/authChooser/SignUpView.d.ts +0 -31
  318. package/lib/typescript/module/ui/components/authChooser/SignUpView.d.ts.map +0 -1
  319. package/lib/typescript/module/ui/components/passkeyHubPopup.d.ts +0 -23
  320. package/lib/typescript/module/ui/components/passkeyHubPopup.d.ts.map +0 -1
  321. package/lib/typescript/module/ui/oauth/legacyRedirectLanes.d.ts +0 -40
  322. package/lib/typescript/module/ui/oauth/legacyRedirectLanes.d.ts.map +0 -1
  323. package/src/ui/components/authChooser/SignInEntryView.tsx +0 -157
  324. package/src/ui/components/authChooser/SignUpView.tsx +0 -76
  325. package/src/ui/components/passkeyHubPopup.ts +0 -28
  326. package/src/ui/oauth/legacyRedirectLanes.ts +0 -43
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Which sign-in methods a surface offers, from where it runs.
3
+ *
4
+ * One screen everywhere; only the transport behind each block changes:
5
+ *
6
+ * - auth.oxy.so (`page`) is where the web signs in: the embedded Commons QR
7
+ * (the split card's right column from `md`, "Continue with Oxy" below it),
8
+ * the username with its Continue, and the passkey — asserted right here,
9
+ * on the one origin every Oxy passkey belongs to;
10
+ * - an app's account dialog on the web (`dialog`) opens that screen in a
11
+ * window over the app ("Continue with Oxy"), like "Sign in with Google":
12
+ * the browser's session lives on auth.oxy.so, so every Oxy app shares it;
13
+ * - native signs in with Commons: "Continue with Oxy", or "Get Commons" on a
14
+ * device that has no Commons to continue with.
15
+ */
16
+
17
+ import type { CommonsAvailability } from '@oxy.so/core';
18
+
19
+ /**
20
+ * `qr` — auth.oxy.so: the embedded QR from `md`, "Continue with Oxy" below.
21
+ * `window` — an app on the web: "Continue with Oxy" opens auth.oxy.so's window.
22
+ * `continue` — native "Continue with Oxy": Oxy picks the route (shared
23
+ * keychain, Commons on this device, a push, or the QR view).
24
+ * `get-commons` — native, and Commons is not installed here.
25
+ */
26
+ export type CommonsEntry = 'qr' | 'window' | 'continue' | 'get-commons';
27
+
28
+ export interface SignInMethods {
29
+ commons: CommonsEntry;
30
+ /** The username and passkey block: only on auth.oxy.so. */
31
+ passkey: boolean;
32
+ }
33
+
34
+ export interface SignInSurfaceFacts {
35
+ /** Rendering in a browser (react-native-web), not a native app. */
36
+ web: boolean;
37
+ /** `page` is auth.oxy.so; `dialog` is an app's account dialog. */
38
+ host: 'dialog' | 'page';
39
+ /** The controller's native probe for an installed Commons. */
40
+ commonsAvailability: CommonsAvailability;
41
+ }
42
+
43
+ export function resolveSignInMethods(facts: SignInSurfaceFacts): SignInMethods {
44
+ if (facts.web) {
45
+ return facts.host === 'page' ? { commons: 'qr', passkey: true } : { commons: 'window', passkey: false };
46
+ }
47
+ return {
48
+ commons: facts.commonsAvailability === 'unavailable' ? 'get-commons' : 'continue',
49
+ passkey: false,
50
+ };
51
+ }
@@ -9,7 +9,7 @@ import {
9
9
  useState,
10
10
  } from 'react';
11
11
  import { Linking, Platform } from 'react-native';
12
- import { OxyServices, oxyClient } from '@oxy.so/core';
12
+ import { DeviceManager, OxyServices, oxyClient, type OxyAuthScreen } from '@oxy.so/core';
13
13
  import type {
14
14
  User,
15
15
  SessionLoginResponse,
@@ -31,7 +31,6 @@ import {
31
31
  notifyAccountDialogVisibility,
32
32
  } from '../navigation/accountDialogManager';
33
33
  import { redirectToAuthorize } from '../components/oauthNavigation';
34
- import { openPasskeyHubPopup } from '../components/passkeyHubPopup';
35
34
  import {
36
35
  startWebOAuthSignIn,
37
36
  type StartWebOAuthSignInOptions,
@@ -149,7 +148,6 @@ export const OxyRuntimeProvider: React.FC<OxyRuntimeProviderProps> = ({
149
148
  sessionMode = 'account',
150
149
  webAuthMode = 'popup',
151
150
  backgroundSession = false,
152
- deviceCredentialStorage = 'persistent',
153
151
  platformStorage,
154
152
  onAuthStateChange,
155
153
  onError,
@@ -170,17 +168,9 @@ export const OxyRuntimeProvider: React.FC<OxyRuntimeProviderProps> = ({
170
168
 
171
169
  // The device-first persisted auth-state store (per-origin device credential on
172
170
  // web; SecureStore session blob on native). Built ONCE per provider mount.
173
- //
174
- // `deviceCredentialStorage` is mount-time configuration for the same reason
175
- // `sessionMode` is: it decides where the durable credential lives, and letting
176
- // it change mid-flight would mean a session that started ephemeral could begin
177
- // writing one.
178
171
  const authStoreRef = useRef<AuthStateStore | null>(null);
179
172
  if (!authStoreRef.current) {
180
- authStoreRef.current = createPlatformAuthStateStore({
181
- sessionMode,
182
- storage: deviceCredentialStorage,
183
- });
173
+ authStoreRef.current = createPlatformAuthStateStore({ sessionMode });
184
174
  }
185
175
  const authStore = authStoreRef.current;
186
176
 
@@ -794,6 +784,20 @@ export const OxyRuntimeProvider: React.FC<OxyRuntimeProviderProps> = ({
794
784
  [webAuthMode, oxyServices, clientId, authorizeBaseUrl, isIdentityBound, user?.id],
795
785
  );
796
786
 
787
+ // On the web an Oxy app signs in and creates accounts in auth.oxy.so's
788
+ // window over the app, like "Sign in with Google": the passkey belongs to
789
+ // that origin, and the browser's session lives there, shared by every Oxy
790
+ // app. A blocked window falls back to the same page in this tab.
791
+ const continueOnAuth = useCallback(
792
+ (screen: OxyAuthScreen): Promise<WebOAuthSignInResult> =>
793
+ startWebOAuthSignInForContext({
794
+ redirectUri: authRedirectUri ?? globalThis.location?.origin ?? '',
795
+ transport: 'popup',
796
+ screen,
797
+ }),
798
+ [startWebOAuthSignInForContext, authRedirectUri],
799
+ );
800
+
797
801
  // ── Unified account dialog ─────────────────────────────────────────────────
798
802
  // The single account-chooser + sign-in surface. Built ONCE per provider mount
799
803
  // and bound to the live `oxyServices` + `sessionClient` + this provider's
@@ -863,11 +867,6 @@ export const OxyRuntimeProvider: React.FC<OxyRuntimeProviderProps> = ({
863
867
  // controller short-circuits, so `redirectToAuthorize` never runs for the
864
868
  // `oxycommons://` payload.
865
869
  canOpenApp: isWebBrowser() ? undefined : (url) => Linking.canOpenURL(url),
866
- // Web-only: lets `startPasskeyHubSignIn` open the auth.oxy.so passkey hub
867
- // popup (b2) for a non-Oxy origin. `undefined` on native — there is no
868
- // popup concept there, and off-origin passkey sign-in isn't reachable
869
- // (Commons owns the native flow).
870
- openPopup: isWebBrowser() ? openPasskeyHubPopup : undefined,
871
870
  // Which surface a sign-in starts from — a FACT only this consumer can
872
871
  // supply (headless core never touches a platform global). It decides
873
872
  // whether automatic delivery may take the same-device Commons deep link;
@@ -983,7 +982,9 @@ export const OxyRuntimeProvider: React.FC<OxyRuntimeProviderProps> = ({
983
982
  username: opts?.username,
984
983
  deviceId: persisted?.deviceId,
985
984
  deviceName: opts?.deviceName,
986
- deviceFingerprint: opts?.deviceFingerprint,
985
+ // The same shape every other sign-in path sends; the server only reads it
986
+ // to place a device that has no persisted id yet.
987
+ deviceFingerprint: opts?.deviceFingerprint ?? JSON.stringify(DeviceManager.getDeviceFingerprint()),
987
988
  });
988
989
  },
989
990
  [oxyServices, authStore, commitSession],
@@ -1284,6 +1285,7 @@ export const OxyRuntimeProvider: React.FC<OxyRuntimeProviderProps> = ({
1284
1285
  revokeSuspiciousSignIn,
1285
1286
  handleWebSession,
1286
1287
  startWebOAuthSignIn: startWebOAuthSignInForContext,
1288
+ continueOnAuth,
1287
1289
  requestOAuthConsent: requestOAuthConsentForContext,
1288
1290
  logout,
1289
1291
  logoutAll,
@@ -1341,6 +1343,7 @@ export const OxyRuntimeProvider: React.FC<OxyRuntimeProviderProps> = ({
1341
1343
  revokeSuspiciousSignIn,
1342
1344
  handleWebSession,
1343
1345
  startWebOAuthSignInForContext,
1346
+ continueOnAuth,
1344
1347
  requestOAuthConsentForContext,
1345
1348
  logout,
1346
1349
  logoutAll,
@@ -1,11 +1,8 @@
1
1
  import type { User } from '@oxy.so/core';
2
2
  import { logger } from '@oxy.so/core';
3
- import type { WebAuthMode } from '../../oauth/types';
4
3
  import {
5
4
  commitDeviceSetAndResolve,
6
- maybeSyncHubAfterCommit,
7
5
  type CommitDeviceSetAndResolveDeps,
8
- type MaybeSyncHubAfterCommitDeps,
9
6
  } from '../commitSessionFlow';
10
7
 
11
8
  // A resolved promise chain (addCurrentAccount -> start -> syncFromClient) settles
@@ -206,92 +203,6 @@ describe('commitDeviceSetAndResolve — cold boot (activate: false)', () => {
206
203
  });
207
204
  });
208
205
 
209
- /**
210
- * Post-sign-in hub sync is a FULL-PAGE redirect to auth.oxy.so. It runs from the
211
- * ONE commit funnel, so gating it here gates every commit path at once —
212
- * `webAuthMode: 'popup'` must never bounce the tab, whichever path signed the
213
- * user in (#691 phase 7).
214
- */
215
- describe('maybeSyncHubAfterCommit — webAuthMode transport gate (#691 phase 7)', () => {
216
- const buildHubDeps = (
217
- overrides: Partial<MaybeSyncHubAfterCommitDeps> = {},
218
- ): MaybeSyncHubAfterCommitDeps => ({
219
- activate: true,
220
- hubSyncRequested: true,
221
- hubSyncEnabled: true,
222
- webAuthMode: 'redirect',
223
- syncHub: jest.fn(async () => true),
224
- ...overrides,
225
- });
226
-
227
- it("redirect mode: syncs the hub after a deliberate sign-in (unchanged)", async () => {
228
- const deps = buildHubDeps();
229
-
230
- await expect(maybeSyncHubAfterCommit(deps)).resolves.toBe(true);
231
-
232
- expect(deps.syncHub).toHaveBeenCalledTimes(1);
233
- });
234
-
235
- it('popup mode: NEVER syncs the hub, even on an otherwise-eligible sign-in', async () => {
236
- const deps = buildHubDeps({ webAuthMode: 'popup' });
237
-
238
- await expect(maybeSyncHubAfterCommit(deps)).resolves.toBe(false);
239
-
240
- expect(deps.syncHub).not.toHaveBeenCalled();
241
- });
242
-
243
- it('popup mode: no commit path can opt back in', async () => {
244
- // Every commit path differs only in `activate` / `hubSyncRequested`; the
245
- // transport gate outranks all of them.
246
- for (const activate of [true, false]) {
247
- for (const hubSyncRequested of [true, false]) {
248
- const deps = buildHubDeps({ webAuthMode: 'popup', activate, hubSyncRequested });
249
- await expect(maybeSyncHubAfterCommit(deps)).resolves.toBe(false);
250
- expect(deps.syncHub).not.toHaveBeenCalled();
251
- }
252
- }
253
- });
254
-
255
- it.each(['popup', 'redirect'] as const)(
256
- 'never syncs on a cold-boot restore, in either mode (%s)',
257
- async (webAuthMode: WebAuthMode) => {
258
- const deps = buildHubDeps({ webAuthMode, activate: false });
259
-
260
- await expect(maybeSyncHubAfterCommit(deps)).resolves.toBe(false);
261
-
262
- expect(deps.syncHub).not.toHaveBeenCalled();
263
- },
264
- );
265
-
266
- it('redirect mode: honours the per-commit opt-out (account switch / popup OAuth lanes)', async () => {
267
- const deps = buildHubDeps({ hubSyncRequested: false });
268
-
269
- await expect(maybeSyncHubAfterCommit(deps)).resolves.toBe(false);
270
-
271
- expect(deps.syncHub).not.toHaveBeenCalled();
272
- });
273
-
274
- it('redirect mode: honours the provider-level hubSync opt-out', async () => {
275
- const deps = buildHubDeps({ hubSyncEnabled: false });
276
-
277
- await expect(maybeSyncHubAfterCommit(deps)).resolves.toBe(false);
278
-
279
- expect(deps.syncHub).not.toHaveBeenCalled();
280
- });
281
-
282
- it('redirect mode: a failing hub sync is non-fatal and never rejects', async () => {
283
- const deps = buildHubDeps({
284
- syncHub: jest.fn(async () => {
285
- throw new Error('hub ticket failed');
286
- }),
287
- });
288
-
289
- await expect(maybeSyncHubAfterCommit(deps)).resolves.toBe(false);
290
-
291
- expect(deps.syncHub).toHaveBeenCalledTimes(1);
292
- });
293
- });
294
-
295
206
  describe('commitDeviceSetAndResolve — deliberate sign-in (activate: true)', () => {
296
207
  it('BLOCKS on the device-set reconcile before resolving auth (unchanged ordering)', async () => {
297
208
  const order: string[] = [];
@@ -1,8 +1,5 @@
1
1
  import type { User } from '@oxy.so/core';
2
2
  import { logger as loggerUtil } from '@oxy.so/core';
3
- import { allowsAutomaticIdpRedirect } from '../oauth/legacyRedirectLanes';
4
- import type { WebAuthMode } from '../oauth/types';
5
- import { isWebBrowser } from '../utils/isWebBrowser';
6
3
  import { isUnauthorizedStatus } from './oxyContextHelpers';
7
4
 
8
5
  const LOG_CONTEXT = { component: 'OxyContext', method: 'commitSession' } as const;
@@ -133,61 +130,3 @@ export async function commitDeviceSetAndResolve(
133
130
  await hydrateAndResolve();
134
131
  void reconcileDeviceSet().catch(logReconcileError);
135
132
  }
136
-
137
- export interface MaybeSyncHubAfterCommitDeps {
138
- /** Deliberate sign-in (`true`) vs. a cold-boot / background commit (`false`). */
139
- activate: boolean;
140
- /** Per-commit opt-in — `commitSession`'s `options.hubSync`. */
141
- hubSyncRequested: boolean;
142
- /** Provider-level opt-out — `OxyProviderProps.hubSync`. */
143
- hubSyncEnabled: boolean;
144
- /**
145
- * The provider's web sign-in transport — `OxyProviderProps.webAuthMode`.
146
- * A first-class input: `'popup'` forbids the redirect outright.
147
- */
148
- webAuthMode: WebAuthMode;
149
- /**
150
- * Starts the full-page hop to `auth.oxy.so/sync`; resolves `true` when the
151
- * navigation was actually started.
152
- */
153
- syncHub: () => Promise<boolean>;
154
- }
155
-
156
- /**
157
- * Post-sign-in hub sync: plant this device's credential on the IdP hub so OTHER
158
- * official origins can silently restore a session on their next cold boot.
159
- *
160
- * The tail of the ONE commit funnel (`commitSession`), extracted so every gate
161
- * on this legacy lane lives — and is tested — in one place. Returns whether the
162
- * full-page redirect was started; a failure is non-fatal and never propagates
163
- * (the sign-in itself already succeeded).
164
- *
165
- * Four gates, all of which must pass:
166
- * 1. `activate` — only a deliberate sign-in syncs; a cold-boot restore never does.
167
- * 2. `hubSyncRequested` — the in-place lanes (account switch, popup OAuth) opt out.
168
- * 3. `hubSyncEnabled` — the provider-level `hubSync` prop.
169
- * 4. `allowsAutomaticIdpRedirect(webAuthMode)` — hub sync REPLACES the document
170
- * with `auth.oxy.so`, so `webAuthMode: 'popup'` forbids it: a redirect that
171
- * bounces the tab defeats the entire point of the mode, no matter which
172
- * commit path produced the session (issue #691, "Cold boot and cross-domain
173
- * behavior"). Redirect mode — the default and the compatibility path — is
174
- * unchanged, and this whole function disappears with it in phase 7b.
175
- */
176
- export async function maybeSyncHubAfterCommit(
177
- deps: MaybeSyncHubAfterCommitDeps,
178
- ): Promise<boolean> {
179
- const { activate, hubSyncRequested, hubSyncEnabled, webAuthMode, syncHub } = deps;
180
-
181
- if (!activate || !hubSyncRequested || !hubSyncEnabled) return false;
182
- if (!allowsAutomaticIdpRedirect(webAuthMode)) return false;
183
- if (!isWebBrowser()) return false;
184
-
185
- try {
186
- return await syncHub();
187
- } catch (hubError) {
188
- if (__DEV__) {
189
- loggerUtil.debug('Hub sync after sign-in failed (non-fatal)', LOG_CONTEXT, hubError);
190
- }
191
- return false;
192
- }
193
- }
@@ -1,5 +1,5 @@
1
1
  import type { ReactNode } from 'react';
2
- import type { OxyServices, User, SessionLoginResponse, AccountNode, CreateAccountInput, ClientSession, AccountDialogController, AccountDialogView, ApiError, SessionClient, SessionMode } from '@oxy.so/core';
2
+ import type { OxyServices, User, SessionLoginResponse, AccountNode, CreateAccountInput, ClientSession, AccountDialogController, AccountDialogView, ApiError, SessionClient, SessionMode, OxyAuthScreen } from '@oxy.so/core';
3
3
  import type { UseFollowHook } from '../hooks/useFollow.types';
4
4
  import type { useLanguageManagement } from '../hooks/useLanguageManagement';
5
5
  import type { RouteName } from '../navigation/routes';
@@ -124,6 +124,14 @@ export interface OxyContextState {
124
124
  */
125
125
  startWebOAuthSignIn: (options: StartWebOAuthSignInOptions) => Promise<WebOAuthSignInResult>;
126
126
 
127
+ /**
128
+ * Sign in (`signin`), create an account (`signup`) or recover one
129
+ * (`recover`) in auth.oxy.so's window over the app, where the browser's
130
+ * shared Oxy session lives. Web only; call it from the press, so the window
131
+ * opens with the gesture.
132
+ */
133
+ continueOnAuth: (screen: OxyAuthScreen) => Promise<WebOAuthSignInResult>;
134
+
127
135
  /**
128
136
  * Ask the already-authenticated user for explicit OAuth consent to exact
129
137
  * application scopes. Must be called from a user gesture. Works on web and
@@ -219,14 +227,6 @@ export interface OxyRuntimeProviderProps {
219
227
  * @default false
220
228
  */
221
229
  backgroundSession?: boolean;
222
- /**
223
- * Whether this origin/app persists the durable device credential at all. See
224
- * `OxyProviderProps.deviceCredentialStorage` for the full rule and the one
225
- * caller of `'ephemeral'`.
226
- *
227
- * @default 'persistent'
228
- */
229
- deviceCredentialStorage?: 'persistent' | 'ephemeral';
230
230
  onAuthStateChange?: (user: User | null) => void;
231
231
  onError?: (error: ApiError) => void;
232
232
  /** Storage instance owned by the public provider; internal composition seam. */
@@ -1,4 +1,5 @@
1
- import type { AccountDialogSnapshot } from '@oxy.so/core';
1
+ import { useCallback, useSyncExternalStore } from 'react';
2
+ import type { AccountDialogController, AccountDialogSnapshot } from '@oxy.so/core';
2
3
 
3
4
  /**
4
5
  * The snapshot `useSyncExternalStore` reads before a controller exists.
@@ -36,6 +37,24 @@ export const EMPTY_ACCOUNT_DIALOG_SNAPSHOT: AccountDialogSnapshot = {
36
37
  openedAt: null,
37
38
  progress: 'idle',
38
39
  attempt: 0,
40
+ inline: false,
39
41
  },
40
42
  commonsAvailability: 'unknown',
41
43
  };
44
+
45
+ /**
46
+ * Bind a surface to `controller`'s snapshot (the inert one while there is no
47
+ * controller). `getSnapshot` returns a stable reference between changes, so
48
+ * it is `useSyncExternalStore`-safe.
49
+ */
50
+ export function useAccountDialogSnapshot(controller: AccountDialogController | null): AccountDialogSnapshot {
51
+ const subscribe = useCallback(
52
+ (listener: () => void) => (controller ? controller.subscribe(listener) : () => undefined),
53
+ [controller],
54
+ );
55
+ const getSnapshot = useCallback(
56
+ () => (controller ? controller.getSnapshot() : EMPTY_ACCOUNT_DIALOG_SNAPSHOT),
57
+ [controller],
58
+ );
59
+ return useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
60
+ }
@@ -1,4 +1,4 @@
1
- import { useCallback, useMemo, useSyncExternalStore } from 'react';
1
+ import { useCallback, useMemo } from 'react';
2
2
  import {
3
3
  buildSwitcherRows,
4
4
  projectDevicePrincipals,
@@ -7,7 +7,7 @@ import {
7
7
  } from '@oxy.so/core';
8
8
  import { useOxy } from '../context/OxyContext';
9
9
  import { useI18n } from './useI18n';
10
- import { EMPTY_ACCOUNT_DIALOG_SNAPSHOT } from './accountDialogSnapshot';
10
+ import { useAccountDialogSnapshot } from './accountDialogSnapshot';
11
11
 
12
12
  export interface UseDeviceSwitcherResult {
13
13
  /**
@@ -60,15 +60,7 @@ export function useDeviceSwitcher(): UseDeviceSwitcherResult {
60
60
  const { accountDialogController: controller, oxyServices } = useOxy();
61
61
  const { locale } = useI18n();
62
62
 
63
- const subscribe = useCallback(
64
- (listener: () => void) => (controller ? controller.subscribe(listener) : () => undefined),
65
- [controller],
66
- );
67
- const getSnapshot = useCallback(
68
- () => (controller ? controller.getSnapshot() : EMPTY_ACCOUNT_DIALOG_SNAPSHOT),
69
- [controller],
70
- );
71
- const snapshot = useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
63
+ const snapshot = useAccountDialogSnapshot(controller);
72
64
 
73
65
  // `directory` is a stable reference between reads (`SessionClient` holds the
74
66
  // one it applied), so this recomputes only when the device actually moved.
@@ -153,6 +153,27 @@ describe('startWebOAuthSignIn', () => {
153
153
  expect(openSpy).toHaveBeenCalledTimes(1);
154
154
  });
155
155
 
156
+ // An Oxy app's account dialog asks for the window whatever the provider's
157
+ // `webAuthMode`, and for the IdP screen the person lands on.
158
+ it('opens the window for `transport: popup` even in redirect mode, with its screen', async () => {
159
+ const context = makeContext({ mode: 'redirect' });
160
+ const popup = fakePopup();
161
+ const openSpy = jest.spyOn(window, 'open').mockReturnValue(popup as unknown as Window);
162
+
163
+ const pending = startWebOAuthSignIn(context, { redirectUri: REDIRECT_URI, transport: 'popup', screen: 'signup' });
164
+ const authorizeUrl = await waitForAuthorizeUrl(popup);
165
+ expect(authorizeUrl.searchParams.get('screen')).toBe('signup');
166
+ expect(authorizeUrl.searchParams.get('response_mode')).toBe('web_message');
167
+ dispatchFromPopup(
168
+ { type: OXY_OAUTH_CODE_MESSAGE_TYPE, code: 'code-1', state: authorizeUrl.searchParams.get('state') },
169
+ popup,
170
+ );
171
+
172
+ await expect(pending).resolves.toEqual({ status: 'signed-in' });
173
+ expect(openSpy).toHaveBeenCalledTimes(1);
174
+ expect(mockRedirect).not.toHaveBeenCalled();
175
+ });
176
+
156
177
  it('falls back to a full-page redirect when the popup was blocked', async () => {
157
178
  const context = makeContext();
158
179
 
@@ -14,7 +14,7 @@
14
14
  * remains the native lane and is untouched by this module.
15
15
  */
16
16
 
17
- import { logger, persistOAuthHandshake } from '@oxy.so/core';
17
+ import { logger, persistOAuthHandshake, type OxyAuthScreen } from '@oxy.so/core';
18
18
  import type { OxyServices } from '@oxy.so/core';
19
19
  import { redirectToAuthorize } from '../components/oauthNavigation';
20
20
  import { isWebBrowser } from '../utils/isWebBrowser';
@@ -64,6 +64,14 @@ export interface StartWebOAuthSignInOptions {
64
64
  popup?: OAuthPopupHandle | null;
65
65
  /** Requested scope; defaults to the SDK's standard sign-in scope. */
66
66
  scope?: string;
67
+ /**
68
+ * The transport for this press, whatever the provider's `webAuthMode`. An
69
+ * Oxy app's own account dialog asks for `popup`: auth.oxy.so's window over
70
+ * the app, where the browser's shared session lives.
71
+ */
72
+ transport?: WebAuthMode;
73
+ /** The IdP screen a person with no session there lands on. */
74
+ screen?: OxyAuthScreen;
67
75
  /** Popup timeout override (ms). */
68
76
  timeoutMs?: number;
69
77
  }
@@ -88,10 +96,10 @@ export async function startWebOAuthSignIn(
88
96
  // Claim the window BEFORE the first `await` below, so a caller that invoked us
89
97
  // straight from the click still has gesture attribution. An explicit `null`
90
98
  // means the caller already tried and was blocked.
91
- const popup =
92
- context.mode === 'popup' && options.popup === undefined ? openOAuthPopup() : options.popup ?? null;
99
+ const mode = options.transport ?? context.mode;
100
+ const popup = mode === 'popup' && options.popup === undefined ? openOAuthPopup() : options.popup ?? null;
93
101
 
94
- if (context.mode === 'redirect') {
102
+ if (mode === 'redirect') {
95
103
  closeOAuthPopup(popup);
96
104
  return startRedirectSignIn(context, options, 'redirect-mode');
97
105
  }
@@ -109,6 +117,7 @@ export async function startWebOAuthSignIn(
109
117
  authorizeBaseUrl: context.authorizeBaseUrl,
110
118
  scope: options.scope,
111
119
  responseMode: 'web_message',
120
+ ...(options.screen ? { screen: options.screen } : {}),
112
121
  });
113
122
 
114
123
  if (!navigateOAuthPopup(popup, prepared.authorizeUrl)) {
@@ -178,6 +187,7 @@ async function startRedirectSignIn(
178
187
  redirectUri: options.redirectUri,
179
188
  authorizeBaseUrl: context.authorizeBaseUrl,
180
189
  scope: options.scope,
190
+ ...(options.screen ? { screen: options.screen } : {}),
181
191
  });
182
192
 
183
193
  if (!persistOAuthHandshake(
@@ -9,7 +9,7 @@
9
9
  * identical, which is what lets both lanes converge on one completion path.
10
10
  */
11
11
 
12
- import { buildOAuthAuthorizeUrl, generateOAuthState, generatePkcePair } from '@oxy.so/core';
12
+ import { buildOAuthAuthorizeUrl, generateOAuthState, generatePkcePair, type OxyAuthScreen } from '@oxy.so/core';
13
13
  import type { OAuthHandshake } from './types';
14
14
 
15
15
  /** Inputs for {@link prepareAuthorizeRequest}. */
@@ -28,6 +28,8 @@ export interface PrepareAuthorizeRequestParams {
28
28
  * not a guarantee — an IdP with no opener still redirects.
29
29
  */
30
30
  responseMode?: 'web_message';
31
+ /** The IdP screen a person with no session there lands on. */
32
+ screen?: OxyAuthScreen;
31
33
  }
32
34
 
33
35
  /** A ready-to-use authorize request plus the secrets that finish it. */
@@ -64,6 +66,7 @@ export async function prepareAuthorizeRequest(
64
66
  state,
65
67
  codeChallenge: pkce.codeChallenge,
66
68
  ...(params.responseMode ? { responseMode: params.responseMode } : {}),
69
+ ...(params.screen ? { screen: params.screen } : {}),
67
70
  });
68
71
 
69
72
  return {
@@ -11,10 +11,9 @@
11
11
  * is still being handled. Anything awaited first (resolving the application,
12
12
  * generating PKCE) loses it and the popup is silently blocked. So the window
13
13
  * is opened EMPTY up front and navigated once the authorize URL exists —
14
- * the same shape as `passkeyHubPopup.ts`.
14
+ * a plain function a test can substitute.
15
15
  * - **No close event.** A cross-origin popup fires nothing when the user
16
- * dismisses it; polling `closed` is the only mechanism (as in core's
17
- * `AccountDialogController.watchPopup`).
16
+ * dismisses it; polling `closed` is the only mechanism.
18
17
  * - **No cross-origin reads.** The popup's URL, title, and document are all
19
18
  * opaque. The authorization result arrives ONLY as a `postMessage`.
20
19
  */
@@ -14,7 +14,7 @@ import { useTheme } from '@oxy.so/bloom/theme';
14
14
  import { Text } from '@oxy.so/bloom/typography';
15
15
  import { SettingsListGroup, SettingsListItem } from '@oxy.so/bloom/settings-list';
16
16
  import {
17
- IDENTITY_WEB_ORIGIN,
17
+ AUTH_WEB_ORIGIN,
18
18
  getAccountDisplayName,
19
19
  getAccountFallbackHandle,
20
20
  getNormalizedUserHandle,
@@ -324,10 +324,9 @@ const ManageAccountScreen: React.FC<BaseScreenProps> = ({
324
324
  return;
325
325
  }
326
326
  // Web: deleting an account is signed with its identity key, which only
327
- // the identity origin can unseal — the deletion happens there, never on
328
- // this page.
327
+ // auth.oxy.so can unseal — the deletion happens there, never on this page.
329
328
  if (isWebBrowser()) {
330
- await Linking.openURL(`${IDENTITY_WEB_ORIGIN}/`).catch(() => {
329
+ await Linking.openURL(`${AUTH_WEB_ORIGIN}/identity`).catch(() => {
331
330
  toast.error(t('accountSwitcher.linkOpenFailed'));
332
331
  });
333
332
  return;
@@ -115,7 +115,7 @@ const TrustLeaderboardScreen: React.FC<BaseScreenProps> = ({ navigate }) => {
115
115
  </TouchableOpacity>
116
116
  );
117
117
  },
118
- [oxyServices, currentUserId, handleEntryPress, locale],
118
+ [oxyServices, currentUserId, handleEntryPress, locale, t],
119
119
  );
120
120
 
121
121
  const keyExtractor = useCallback(
@@ -7,7 +7,6 @@
7
7
  * store shape + logic (`createWebAuthStateStore` / `createNativeAuthStateStore` /
8
8
  * `createMemoryAuthStateStore`); this module only selects the seam:
9
9
  *
10
- * - `storage: 'ephemeral'` → `createMemoryAuthStateStore()`, on EVERY platform.
11
10
  * - web → `createWebAuthStateStore()` (localStorage, in-memory fallback).
12
11
  * - native → `createNativeAuthStateStore(secureKV)` for the SESSION blob over
13
12
  * the shared `createNativeSecureKeyValueStorage()` adapter
@@ -23,7 +22,6 @@
23
22
  import {
24
23
  createWebAuthStateStore,
25
24
  createNativeAuthStateStore,
26
- createMemoryAuthStateStore,
27
25
  createSharedMirroringAuthStateStore,
28
26
  type AuthStateStore,
29
27
  type SessionMode,
@@ -46,20 +44,6 @@ export interface PlatformAuthStateStoreOptions {
46
44
  * a decision a storage seam gets to make.
47
45
  */
48
46
  sessionMode?: SessionMode;
49
- /**
50
- * Whether this origin/app may persist a durable device credential AT ALL.
51
- *
52
- * `'ephemeral'` stores nothing durable and mirrors nothing: the session lives
53
- * in memory for the lifetime of the page and is gone on reload. Its one caller
54
- * is `auth.oxy.so` with the browser hub enabled (issue #937 Phase 5, ADR 0003),
55
- * where the durable credential for the browser profile is the server-side
56
- * DeviceSession behind the `__Host-oxy-device` handle.
57
- *
58
- * See `OxyProviderProps.deviceCredentialStorage` for why the answer to "let the
59
- * hub be authoritative" is to stop persisting the other credential rather than
60
- * to consult it second.
61
- */
62
- storage?: 'persistent' | 'ephemeral';
63
47
  }
64
48
 
65
49
  /**
@@ -68,31 +52,10 @@ export interface PlatformAuthStateStoreOptions {
68
52
  * Native persists the SESSION blob (`deviceId` + `deviceSecret` + cached access
69
53
  * token) per-app in SecureStore; the SDK re-mints the access token from the
70
54
  * device credential on the next cold boot.
71
- *
72
- * ## The ephemeral check is FIRST, and the order is load-bearing
73
- *
74
- * It short-circuits above the `isReactNative()` branch so an ephemeral caller can
75
- * never reach the native path — and therefore can never reach the shared-slot
76
- * mirroring wrapper. Checked after that branch instead, an origin that has
77
- * declined to persist a credential would publish one into the device-wide slot
78
- * every sibling app adopts on cold boot: it would keep nothing itself while
79
- * deciding which session five other apps boot into.
80
- *
81
- * That is unreachable today because the only ephemeral caller is a web origin, so
82
- * `isReactNative()` is false there anyway. Unreachable today is exactly the kind
83
- * of guarantee that stops holding when someone adds the second caller, so it is
84
- * structural here rather than incidental, and
85
- * `__tests__/session/authStoreEphemeral.test.ts` holds the ordering directly.
86
55
  */
87
56
  export function createPlatformAuthStateStore(
88
57
  options: PlatformAuthStateStoreOptions = {},
89
58
  ): AuthStateStore {
90
- // FIRST, above every platform branch — see the docblock for why the ordering
91
- // is the guarantee and not a coincidence.
92
- if (options.storage === 'ephemeral') {
93
- return createMemoryAuthStateStore();
94
- }
95
-
96
59
  if (!isReactNative()) {
97
60
  return createWebAuthStateStore();
98
61
  }