@oxyhq/services 15.0.0 → 17.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 (280) hide show
  1. package/lib/commonjs/index.js +25 -55
  2. package/lib/commonjs/index.js.map +1 -1
  3. package/lib/commonjs/ui/client.js +0 -14
  4. package/lib/commonjs/ui/client.js.map +1 -1
  5. package/lib/commonjs/ui/components/OxyAccountDialog.js +764 -0
  6. package/lib/commonjs/ui/components/OxyAccountDialog.js.map +1 -0
  7. package/lib/commonjs/ui/components/OxyProvider.js +11 -6
  8. package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
  9. package/lib/commonjs/ui/components/OxySignInButton.js +10 -21
  10. package/lib/commonjs/ui/components/OxySignInButton.js.map +1 -1
  11. package/lib/commonjs/ui/components/ProfileButton.js +25 -112
  12. package/lib/commonjs/ui/components/ProfileButton.js.map +1 -1
  13. package/lib/commonjs/ui/components/RequireOxyAuth.js +299 -0
  14. package/lib/commonjs/ui/components/RequireOxyAuth.js.map +1 -0
  15. package/lib/commonjs/ui/context/OxyContext.js +106 -2
  16. package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
  17. package/lib/commonjs/ui/hooks/mutations/mutationKeys.js +1 -1
  18. package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js +10 -10
  19. package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js.map +1 -1
  20. package/lib/commonjs/ui/hooks/queries/queryKeys.js +1 -1
  21. package/lib/commonjs/ui/hooks/queries/useAccountQueries.js +7 -8
  22. package/lib/commonjs/ui/hooks/queries/useAccountQueries.js.map +1 -1
  23. package/lib/commonjs/ui/hooks/useAuth.js +19 -30
  24. package/lib/commonjs/ui/hooks/useAuth.js.map +1 -1
  25. package/lib/commonjs/ui/hooks/useSwitchableAccounts.js +37 -267
  26. package/lib/commonjs/ui/hooks/useSwitchableAccounts.js.map +1 -1
  27. package/lib/commonjs/ui/index.js +5 -40
  28. package/lib/commonjs/ui/index.js.map +1 -1
  29. package/lib/commonjs/ui/navigation/accountDialogManager.js +91 -0
  30. package/lib/commonjs/ui/navigation/accountDialogManager.js.map +1 -0
  31. package/lib/commonjs/ui/navigation/routes.js +0 -2
  32. package/lib/commonjs/ui/navigation/routes.js.map +1 -1
  33. package/lib/commonjs/ui/screens/ConnectedAppsScreen.js +17 -18
  34. package/lib/commonjs/ui/screens/ConnectedAppsScreen.js.map +1 -1
  35. package/lib/commonjs/ui/screens/ManageAccountScreen.js +4 -3
  36. package/lib/commonjs/ui/screens/ManageAccountScreen.js.map +1 -1
  37. package/lib/commonjs/ui/session/createSessionClient.js +10 -2
  38. package/lib/commonjs/ui/session/createSessionClient.js.map +1 -1
  39. package/lib/module/index.js +20 -17
  40. package/lib/module/index.js.map +1 -1
  41. package/lib/module/ui/client.js +1 -2
  42. package/lib/module/ui/client.js.map +1 -1
  43. package/lib/module/ui/components/OxyAccountDialog.js +761 -0
  44. package/lib/module/ui/components/OxyAccountDialog.js.map +1 -0
  45. package/lib/module/ui/components/OxyProvider.js +11 -6
  46. package/lib/module/ui/components/OxyProvider.js.map +1 -1
  47. package/lib/module/ui/components/OxySignInButton.js +10 -21
  48. package/lib/module/ui/components/OxySignInButton.js.map +1 -1
  49. package/lib/module/ui/components/ProfileButton.js +26 -112
  50. package/lib/module/ui/components/ProfileButton.js.map +1 -1
  51. package/lib/module/ui/components/RequireOxyAuth.js +294 -0
  52. package/lib/module/ui/components/RequireOxyAuth.js.map +1 -0
  53. package/lib/module/ui/context/OxyContext.js +107 -3
  54. package/lib/module/ui/context/OxyContext.js.map +1 -1
  55. package/lib/module/ui/hooks/mutations/mutationKeys.js +1 -1
  56. package/lib/module/ui/hooks/mutations/useAccountMutations.js +8 -8
  57. package/lib/module/ui/hooks/mutations/useAccountMutations.js.map +1 -1
  58. package/lib/module/ui/hooks/queries/queryKeys.js +1 -1
  59. package/lib/module/ui/hooks/queries/useAccountQueries.js +5 -6
  60. package/lib/module/ui/hooks/queries/useAccountQueries.js.map +1 -1
  61. package/lib/module/ui/hooks/useAuth.js +19 -30
  62. package/lib/module/ui/hooks/useAuth.js.map +1 -1
  63. package/lib/module/ui/hooks/useSwitchableAccounts.js +38 -267
  64. package/lib/module/ui/hooks/useSwitchableAccounts.js.map +1 -1
  65. package/lib/module/ui/index.js +1 -5
  66. package/lib/module/ui/index.js.map +1 -1
  67. package/lib/module/ui/navigation/accountDialogManager.js +81 -0
  68. package/lib/module/ui/navigation/accountDialogManager.js.map +1 -0
  69. package/lib/module/ui/navigation/routes.js +0 -2
  70. package/lib/module/ui/navigation/routes.js.map +1 -1
  71. package/lib/module/ui/screens/ConnectedAppsScreen.js +19 -20
  72. package/lib/module/ui/screens/ConnectedAppsScreen.js.map +1 -1
  73. package/lib/module/ui/screens/ManageAccountScreen.js +4 -3
  74. package/lib/module/ui/screens/ManageAccountScreen.js.map +1 -1
  75. package/lib/module/ui/session/createSessionClient.js +10 -2
  76. package/lib/module/ui/session/createSessionClient.js.map +1 -1
  77. package/lib/typescript/commonjs/index.d.ts +6 -13
  78. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  79. package/lib/typescript/commonjs/ui/client.d.ts +0 -4
  80. package/lib/typescript/commonjs/ui/client.d.ts.map +1 -1
  81. package/lib/typescript/commonjs/ui/components/OxyAccountDialog.d.ts +35 -0
  82. package/lib/typescript/commonjs/ui/components/OxyAccountDialog.d.ts.map +1 -0
  83. package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts +2 -2
  84. package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts.map +1 -1
  85. package/lib/typescript/commonjs/ui/components/OxySignInButton.d.ts.map +1 -1
  86. package/lib/typescript/commonjs/ui/components/ProfileButton.d.ts +11 -23
  87. package/lib/typescript/commonjs/ui/components/ProfileButton.d.ts.map +1 -1
  88. package/lib/typescript/commonjs/ui/components/RequireOxyAuth.d.ts +55 -0
  89. package/lib/typescript/commonjs/ui/components/RequireOxyAuth.d.ts.map +1 -0
  90. package/lib/typescript/commonjs/ui/context/OxyContext.d.ts +13 -1
  91. package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
  92. package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts +4 -4
  93. package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
  94. package/lib/typescript/commonjs/ui/hooks/queries/useAccountQueries.d.ts +6 -7
  95. package/lib/typescript/commonjs/ui/hooks/queries/useAccountQueries.d.ts.map +1 -1
  96. package/lib/typescript/commonjs/ui/hooks/useAuth.d.ts.map +1 -1
  97. package/lib/typescript/commonjs/ui/hooks/useSwitchableAccounts.d.ts +13 -152
  98. package/lib/typescript/commonjs/ui/hooks/useSwitchableAccounts.d.ts.map +1 -1
  99. package/lib/typescript/commonjs/ui/index.d.ts +2 -5
  100. package/lib/typescript/commonjs/ui/index.d.ts.map +1 -1
  101. package/lib/typescript/commonjs/ui/navigation/accountDialogManager.d.ts +49 -0
  102. package/lib/typescript/commonjs/ui/navigation/accountDialogManager.d.ts.map +1 -0
  103. package/lib/typescript/commonjs/ui/navigation/routes.d.ts +1 -1
  104. package/lib/typescript/commonjs/ui/navigation/routes.d.ts.map +1 -1
  105. package/lib/typescript/commonjs/ui/screens/ConnectedAppsScreen.d.ts.map +1 -1
  106. package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts +1 -1
  107. package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts.map +1 -1
  108. package/lib/typescript/commonjs/ui/session/createSessionClient.d.ts +9 -2
  109. package/lib/typescript/commonjs/ui/session/createSessionClient.d.ts.map +1 -1
  110. package/lib/typescript/commonjs/ui/types/navigation.d.ts +9 -0
  111. package/lib/typescript/commonjs/ui/types/navigation.d.ts.map +1 -1
  112. package/lib/typescript/commonjs/ui/utils/storageHelpers.d.ts +7 -7
  113. package/lib/typescript/module/index.d.ts +6 -13
  114. package/lib/typescript/module/index.d.ts.map +1 -1
  115. package/lib/typescript/module/ui/client.d.ts +0 -4
  116. package/lib/typescript/module/ui/client.d.ts.map +1 -1
  117. package/lib/typescript/module/ui/components/OxyAccountDialog.d.ts +35 -0
  118. package/lib/typescript/module/ui/components/OxyAccountDialog.d.ts.map +1 -0
  119. package/lib/typescript/module/ui/components/OxyProvider.d.ts +2 -2
  120. package/lib/typescript/module/ui/components/OxyProvider.d.ts.map +1 -1
  121. package/lib/typescript/module/ui/components/OxySignInButton.d.ts.map +1 -1
  122. package/lib/typescript/module/ui/components/ProfileButton.d.ts +11 -23
  123. package/lib/typescript/module/ui/components/ProfileButton.d.ts.map +1 -1
  124. package/lib/typescript/module/ui/components/RequireOxyAuth.d.ts +55 -0
  125. package/lib/typescript/module/ui/components/RequireOxyAuth.d.ts.map +1 -0
  126. package/lib/typescript/module/ui/context/OxyContext.d.ts +13 -1
  127. package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
  128. package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts +4 -4
  129. package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
  130. package/lib/typescript/module/ui/hooks/queries/useAccountQueries.d.ts +6 -7
  131. package/lib/typescript/module/ui/hooks/queries/useAccountQueries.d.ts.map +1 -1
  132. package/lib/typescript/module/ui/hooks/useAuth.d.ts.map +1 -1
  133. package/lib/typescript/module/ui/hooks/useSwitchableAccounts.d.ts +13 -152
  134. package/lib/typescript/module/ui/hooks/useSwitchableAccounts.d.ts.map +1 -1
  135. package/lib/typescript/module/ui/index.d.ts +2 -5
  136. package/lib/typescript/module/ui/index.d.ts.map +1 -1
  137. package/lib/typescript/module/ui/navigation/accountDialogManager.d.ts +49 -0
  138. package/lib/typescript/module/ui/navigation/accountDialogManager.d.ts.map +1 -0
  139. package/lib/typescript/module/ui/navigation/routes.d.ts +1 -1
  140. package/lib/typescript/module/ui/navigation/routes.d.ts.map +1 -1
  141. package/lib/typescript/module/ui/screens/ConnectedAppsScreen.d.ts.map +1 -1
  142. package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts +1 -1
  143. package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts.map +1 -1
  144. package/lib/typescript/module/ui/session/createSessionClient.d.ts +9 -2
  145. package/lib/typescript/module/ui/session/createSessionClient.d.ts.map +1 -1
  146. package/lib/typescript/module/ui/types/navigation.d.ts +9 -0
  147. package/lib/typescript/module/ui/types/navigation.d.ts.map +1 -1
  148. package/lib/typescript/module/ui/utils/storageHelpers.d.ts +7 -7
  149. package/package.json +4 -4
  150. package/src/index.ts +23 -28
  151. package/src/ui/client.ts +0 -4
  152. package/src/ui/components/OxyAccountDialog.tsx +760 -0
  153. package/src/ui/components/OxyProvider.tsx +12 -6
  154. package/src/ui/components/OxySignInButton.tsx +10 -21
  155. package/src/ui/components/ProfileButton.tsx +23 -126
  156. package/src/ui/components/RequireOxyAuth.tsx +266 -0
  157. package/src/ui/context/OxyContext.tsx +146 -7
  158. package/src/ui/hooks/mutations/mutationKeys.ts +1 -1
  159. package/src/ui/hooks/mutations/useAccountMutations.ts +8 -8
  160. package/src/ui/hooks/queries/queryKeys.ts +1 -1
  161. package/src/ui/hooks/queries/useAccountQueries.ts +8 -9
  162. package/src/ui/hooks/useAuth.ts +19 -31
  163. package/src/ui/hooks/useSwitchableAccounts.ts +42 -376
  164. package/src/ui/index.ts +2 -5
  165. package/src/ui/navigation/accountDialogManager.ts +84 -0
  166. package/src/ui/navigation/routes.ts +1 -5
  167. package/src/ui/screens/ConnectedAppsScreen.tsx +23 -24
  168. package/src/ui/screens/ManageAccountScreen.tsx +3 -2
  169. package/src/ui/session/createSessionClient.ts +9 -1
  170. package/src/ui/types/navigation.ts +9 -0
  171. package/src/ui/utils/storageHelpers.ts +7 -7
  172. package/lib/commonjs/ui/components/AccountMenu.js +0 -598
  173. package/lib/commonjs/ui/components/AccountMenu.js.map +0 -1
  174. package/lib/commonjs/ui/components/AccountMenuButton.js +0 -135
  175. package/lib/commonjs/ui/components/AccountMenuButton.js.map +0 -1
  176. package/lib/commonjs/ui/components/AccountSwitcher.js +0 -780
  177. package/lib/commonjs/ui/components/AccountSwitcher.js.map +0 -1
  178. package/lib/commonjs/ui/components/AnotherDeviceQR.js +0 -116
  179. package/lib/commonjs/ui/components/AnotherDeviceQR.js.map +0 -1
  180. package/lib/commonjs/ui/components/ProfileMenu.js +0 -518
  181. package/lib/commonjs/ui/components/ProfileMenu.js.map +0 -1
  182. package/lib/commonjs/ui/components/SignInAccountChooser.js +0 -189
  183. package/lib/commonjs/ui/components/SignInAccountChooser.js.map +0 -1
  184. package/lib/commonjs/ui/components/SignInModal.js +0 -600
  185. package/lib/commonjs/ui/components/SignInModal.js.map +0 -1
  186. package/lib/commonjs/ui/hooks/useOxyAuthSession.js +0 -501
  187. package/lib/commonjs/ui/hooks/useOxyAuthSession.js.map +0 -1
  188. package/lib/commonjs/ui/hooks/usePasswordSignIn.js +0 -170
  189. package/lib/commonjs/ui/hooks/usePasswordSignIn.js.map +0 -1
  190. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +0 -51
  191. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +0 -1
  192. package/lib/commonjs/ui/screens/OxyAuthScreen.js +0 -312
  193. package/lib/commonjs/ui/screens/OxyAuthScreen.js.map +0 -1
  194. package/lib/commonjs/utils/deviceFlowSignIn.js +0 -109
  195. package/lib/commonjs/utils/deviceFlowSignIn.js.map +0 -1
  196. package/lib/module/ui/components/AccountMenu.js +0 -593
  197. package/lib/module/ui/components/AccountMenu.js.map +0 -1
  198. package/lib/module/ui/components/AccountMenuButton.js +0 -130
  199. package/lib/module/ui/components/AccountMenuButton.js.map +0 -1
  200. package/lib/module/ui/components/AccountSwitcher.js +0 -774
  201. package/lib/module/ui/components/AccountSwitcher.js.map +0 -1
  202. package/lib/module/ui/components/AnotherDeviceQR.js +0 -110
  203. package/lib/module/ui/components/AnotherDeviceQR.js.map +0 -1
  204. package/lib/module/ui/components/ProfileMenu.js +0 -514
  205. package/lib/module/ui/components/ProfileMenu.js.map +0 -1
  206. package/lib/module/ui/components/SignInAccountChooser.js +0 -183
  207. package/lib/module/ui/components/SignInAccountChooser.js.map +0 -1
  208. package/lib/module/ui/components/SignInModal.js +0 -591
  209. package/lib/module/ui/components/SignInModal.js.map +0 -1
  210. package/lib/module/ui/hooks/useOxyAuthSession.js +0 -495
  211. package/lib/module/ui/hooks/useOxyAuthSession.js.map +0 -1
  212. package/lib/module/ui/hooks/usePasswordSignIn.js +0 -165
  213. package/lib/module/ui/hooks/usePasswordSignIn.js.map +0 -1
  214. package/lib/module/ui/screens/AccountSwitcherScreen.js +0 -48
  215. package/lib/module/ui/screens/AccountSwitcherScreen.js.map +0 -1
  216. package/lib/module/ui/screens/OxyAuthScreen.js +0 -306
  217. package/lib/module/ui/screens/OxyAuthScreen.js.map +0 -1
  218. package/lib/module/utils/deviceFlowSignIn.js +0 -106
  219. package/lib/module/utils/deviceFlowSignIn.js.map +0 -1
  220. package/lib/typescript/commonjs/ui/components/AccountMenu.d.ts +0 -47
  221. package/lib/typescript/commonjs/ui/components/AccountMenu.d.ts.map +0 -1
  222. package/lib/typescript/commonjs/ui/components/AccountMenuButton.d.ts +0 -26
  223. package/lib/typescript/commonjs/ui/components/AccountMenuButton.d.ts.map +0 -1
  224. package/lib/typescript/commonjs/ui/components/AccountSwitcher.d.ts +0 -46
  225. package/lib/typescript/commonjs/ui/components/AccountSwitcher.d.ts.map +0 -1
  226. package/lib/typescript/commonjs/ui/components/AnotherDeviceQR.d.ts +0 -34
  227. package/lib/typescript/commonjs/ui/components/AnotherDeviceQR.d.ts.map +0 -1
  228. package/lib/typescript/commonjs/ui/components/ProfileMenu.d.ts +0 -49
  229. package/lib/typescript/commonjs/ui/components/ProfileMenu.d.ts.map +0 -1
  230. package/lib/typescript/commonjs/ui/components/SignInAccountChooser.d.ts +0 -29
  231. package/lib/typescript/commonjs/ui/components/SignInAccountChooser.d.ts.map +0 -1
  232. package/lib/typescript/commonjs/ui/components/SignInModal.d.ts +0 -28
  233. package/lib/typescript/commonjs/ui/components/SignInModal.d.ts.map +0 -1
  234. package/lib/typescript/commonjs/ui/hooks/useOxyAuthSession.d.ts +0 -105
  235. package/lib/typescript/commonjs/ui/hooks/useOxyAuthSession.d.ts.map +0 -1
  236. package/lib/typescript/commonjs/ui/hooks/usePasswordSignIn.d.ts +0 -31
  237. package/lib/typescript/commonjs/ui/hooks/usePasswordSignIn.d.ts.map +0 -1
  238. package/lib/typescript/commonjs/ui/screens/AccountSwitcherScreen.d.ts +0 -11
  239. package/lib/typescript/commonjs/ui/screens/AccountSwitcherScreen.d.ts.map +0 -1
  240. package/lib/typescript/commonjs/ui/screens/OxyAuthScreen.d.ts +0 -22
  241. package/lib/typescript/commonjs/ui/screens/OxyAuthScreen.d.ts.map +0 -1
  242. package/lib/typescript/commonjs/utils/deviceFlowSignIn.d.ts +0 -97
  243. package/lib/typescript/commonjs/utils/deviceFlowSignIn.d.ts.map +0 -1
  244. package/lib/typescript/module/ui/components/AccountMenu.d.ts +0 -47
  245. package/lib/typescript/module/ui/components/AccountMenu.d.ts.map +0 -1
  246. package/lib/typescript/module/ui/components/AccountMenuButton.d.ts +0 -26
  247. package/lib/typescript/module/ui/components/AccountMenuButton.d.ts.map +0 -1
  248. package/lib/typescript/module/ui/components/AccountSwitcher.d.ts +0 -46
  249. package/lib/typescript/module/ui/components/AccountSwitcher.d.ts.map +0 -1
  250. package/lib/typescript/module/ui/components/AnotherDeviceQR.d.ts +0 -34
  251. package/lib/typescript/module/ui/components/AnotherDeviceQR.d.ts.map +0 -1
  252. package/lib/typescript/module/ui/components/ProfileMenu.d.ts +0 -49
  253. package/lib/typescript/module/ui/components/ProfileMenu.d.ts.map +0 -1
  254. package/lib/typescript/module/ui/components/SignInAccountChooser.d.ts +0 -29
  255. package/lib/typescript/module/ui/components/SignInAccountChooser.d.ts.map +0 -1
  256. package/lib/typescript/module/ui/components/SignInModal.d.ts +0 -28
  257. package/lib/typescript/module/ui/components/SignInModal.d.ts.map +0 -1
  258. package/lib/typescript/module/ui/hooks/useOxyAuthSession.d.ts +0 -105
  259. package/lib/typescript/module/ui/hooks/useOxyAuthSession.d.ts.map +0 -1
  260. package/lib/typescript/module/ui/hooks/usePasswordSignIn.d.ts +0 -31
  261. package/lib/typescript/module/ui/hooks/usePasswordSignIn.d.ts.map +0 -1
  262. package/lib/typescript/module/ui/screens/AccountSwitcherScreen.d.ts +0 -11
  263. package/lib/typescript/module/ui/screens/AccountSwitcherScreen.d.ts.map +0 -1
  264. package/lib/typescript/module/ui/screens/OxyAuthScreen.d.ts +0 -22
  265. package/lib/typescript/module/ui/screens/OxyAuthScreen.d.ts.map +0 -1
  266. package/lib/typescript/module/utils/deviceFlowSignIn.d.ts +0 -97
  267. package/lib/typescript/module/utils/deviceFlowSignIn.d.ts.map +0 -1
  268. package/src/ui/components/AccountMenu.tsx +0 -645
  269. package/src/ui/components/AccountMenuButton.tsx +0 -126
  270. package/src/ui/components/AccountSwitcher.tsx +0 -751
  271. package/src/ui/components/AnotherDeviceQR.tsx +0 -119
  272. package/src/ui/components/ProfileMenu.tsx +0 -564
  273. package/src/ui/components/SignInAccountChooser.tsx +0 -162
  274. package/src/ui/components/SignInModal.tsx +0 -530
  275. package/src/ui/hooks/useOxyAuthSession.ts +0 -635
  276. package/src/ui/hooks/usePasswordSignIn.ts +0 -207
  277. package/src/ui/screens/AccountSwitcherScreen.tsx +0 -43
  278. package/src/ui/screens/OxyAuthScreen.tsx +0 -324
  279. package/src/utils/__tests__/deviceFlowSignIn.test.ts +0 -231
  280. package/src/utils/deviceFlowSignIn.ts +0 -152
@@ -1 +0,0 @@
1
- {"version":3,"names":["useCallback","useMemo","useRef","useState","useOxy","handleAuthError","usePasswordSignIn","options","signInWithPassword","completeTwoFactorSignIn","onSignedIn","step","setStep","identifier","setIdentifier","password","setPassword","code","setCode","useBackupCode","setUseBackupCode","error","setError","isSubmitting","setIsSubmitting","loginToken","setLoginToken","submittingRef","surfaceError","err","defaultMessage","submitIdentifier","trim","submitPassword","current","result","status","submitTwoFactor","backupCode","token","back","reset"],"sourceRoot":"../../../../src","sources":["ui/hooks/usePasswordSignIn.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAC9D,SAASC,MAAM,QAAQ,0BAAuB;AAC9C,SAASC,eAAe,QAAQ,2BAAwB;AAkCxD,OAAO,SAASC,iBAAiBA,CAACC,OAAiC,GAAG,CAAC,CAAC,EAA2B;EACjG,MAAM;IAAEC,kBAAkB;IAAEC;EAAwB,CAAC,GAAGL,MAAM,CAAC,CAAC;EAChE,MAAM;IAAEM;EAAW,CAAC,GAAGH,OAAO;EAE9B,MAAM,CAACI,IAAI,EAAEC,OAAO,CAAC,GAAGT,QAAQ,CAAqB,YAAY,CAAC;EAClE,MAAM,CAACU,UAAU,EAAEC,aAAa,CAAC,GAAGX,QAAQ,CAAC,EAAE,CAAC;EAChD,MAAM,CAACY,QAAQ,EAAEC,WAAW,CAAC,GAAGb,QAAQ,CAAC,EAAE,CAAC;EAC5C,MAAM,CAACc,IAAI,EAAEC,OAAO,CAAC,GAAGf,QAAQ,CAAC,EAAE,CAAC;EACpC,MAAM,CAACgB,aAAa,EAAEC,gBAAgB,CAAC,GAAGjB,QAAQ,CAAC,KAAK,CAAC;EACzD,MAAM,CAACkB,KAAK,EAAEC,QAAQ,CAAC,GAAGnB,QAAQ,CAAgB,IAAI,CAAC;EACvD,MAAM,CAACoB,YAAY,EAAEC,eAAe,CAAC,GAAGrB,QAAQ,CAAC,KAAK,CAAC;EACvD,MAAM,CAACsB,UAAU,EAAEC,aAAa,CAAC,GAAGvB,QAAQ,CAAgB,IAAI,CAAC;;EAEjE;EACA;EACA;EACA;EACA;EACA,MAAMwB,aAAa,GAAGzB,MAAM,CAAC,KAAK,CAAC;EAEnC,MAAM0B,YAAY,GAAG5B,WAAW,CAAC,CA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OAAO,CAAC,EAAE,CAAC;QACX,OAAO,UAAU;MACnB;MACA,IAAIgB,OAAO,KAAK,UAAU,EAAE;QAC1BlB,WAAW,CAAC,EAAE,CAAC;QACf,OAAO,YAAY;MACrB;MACA,OAAOkB,OAAO;IAChB,CAAC,CAAC;EACJ,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMO,KAAK,GAAGzC,WAAW,CAAC,MAAM;IAC9BY,OAAO,CAAC,YAAY,CAAC;IACrBE,aAAa,CAAC,EAAE,CAAC;IACjBE,WAAW,CAAC,EAAE,CAAC;IACfE,OAAO,CAAC,EAAE,CAAC;IACXE,gBAAgB,CAAC,KAAK,CAAC;IACvBM,aAAa,CAAC,IAAI,CAAC;IACnBJ,QAAQ,CAAC,IAAI,CAAC;IACdK,aAAa,CAACO,OAAO,GAAG,KAAK;IAC7BV,eAAe,CAAC,KAAK,CAAC;EACxB,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOvB,OAAO,CACZ,OAAO;IACLU,IAAI;IACJE,UAAU;IACVC,aAAa;IACbC,QAAQ;IACRC,WAAW;IACXC,IAAI;IACJC,OAAO;IACPC,aAAa;IACbC,gBAAgB;IAChBC,KAAK;IACLE,YAAY;IACZQ,gBAAgB;IAChBE,cAAc;IACdI,eAAe;IACfG,IAAI;IACJC;EACF,CAAC,CAAC,EACF,CACE9B,IAAI,EACJE,UAAU,EACVE,QAAQ,EACRE,IAAI,EACJE,aAAa,EACbE,KAAK,EACLE,YAAY,EACZQ,gBAAgB,EAChBE,cAAc,EACdI,eAAe,EACfG,IAAI,EACJC,KAAK,CAET,CAAC;AACH","ignoreList":[]}
@@ -1,48 +0,0 @@
1
- "use strict";
2
-
3
- import { useCallback } from 'react';
4
- import { View } from 'react-native';
5
- import Header from "../components/Header.js";
6
- import { AccountSwitcherView } from "../components/AccountSwitcher.js";
7
- import { useI18n } from "../hooks/useI18n.js";
8
-
9
- /**
10
- * Bottom-sheet route wrapper around {@link AccountSwitcherView}. Used when the
11
- * switcher is opened as a sheet (e.g. from the "Your accounts" entry in
12
- * ManageAccount) rather than as the header-chip popover (which uses the
13
- * `AccountSwitcher` modal directly).
14
- */
15
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
16
- const AccountSwitcherScreen = ({
17
- onClose,
18
- goBack,
19
- navigate
20
- }) => {
21
- const {
22
- t
23
- } = useI18n();
24
- const close = useCallback(() => {
25
- (onClose ?? goBack)?.();
26
- }, [onClose, goBack]);
27
- return /*#__PURE__*/_jsxs(View, {
28
- className: "flex-1 bg-bg",
29
- children: [/*#__PURE__*/_jsx(Header, {
30
- title: t('accountSwitcher.title') || 'Switch account',
31
- onBack: goBack,
32
- onClose: onClose,
33
- showBackButton: !!goBack,
34
- showCloseButton: !!onClose,
35
- elevation: "subtle"
36
- }), /*#__PURE__*/_jsx(AccountSwitcherView, {
37
- onClose: close,
38
- onAddAccount: () => navigate?.('OxyAuth'),
39
- onNavigateManage: () => navigate?.('ManageAccount'),
40
- onCreateAccount: () => navigate?.('CreateAccount'),
41
- onOpenAccountSettings: accountId => navigate?.('AccountSettings', {
42
- accountId
43
- })
44
- })]
45
- });
46
- };
47
- export default AccountSwitcherScreen;
48
- //# sourceMappingURL=AccountSwitcherScreen.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["useCallback","View","Header","AccountSwitcherView","useI18n","jsx","_jsx","jsxs","_jsxs","AccountSwitcherScreen","onClose","goBack","navigate","t","close","className","children","title","onBack","showBackButton","showCloseButton","elevation","onAddAccount","onNavigateManage","onCreateAccount","onOpenAccountSettings","accountId"],"sourceRoot":"../../../../src","sources":["ui/screens/AccountSwitcherScreen.tsx"],"mappings":";;AACA,SAASA,WAAW,QAAQ,OAAO;AACnC,SAASC,IAAI,QAAQ,cAAc;AAEnC,OAAOC,MAAM,MAAM,yBAAsB;AACzC,SAASC,mBAAmB,QAAQ,kCAA+B;AACnE,SAASC,OAAO,QAAQ,qBAAkB;;AAE1C;AACA;AACA;AACA;AACA;AACA;AALA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAMA,MAAMC,qBAAgD,GAAGA,CAAC;EAAEC,OAAO;EAAEC,MAAM;EAAEC;AAAS,CAAC,KAAK;EAC1F,MAAM;IAAEC;EAAE,CAAC,GAAGT,OAAO,CAAC,CAAC;EAEvB,MAAMU,KAAK,GAAGd,WAAW,CAAC,MAAM;IAC9B,CAACU,OAAO,IAAIC,MAAM,IAAI,CAAC;EACzB,CAAC,EAAE,CAACD,OAAO,EAAEC,MAAM,CAAC,CAAC;EAErB,oBACEH,KAAA,CAACP,IAAI;IAACc,SAAS,EAAC,cAAc;IAAAC,QAAA,gBAC5BV,IAAA,CAACJ,MAAM;MACLe,KAAK,EAAEJ,CAAC,CAAC,uBAAuB,CAAC,IAAI,gBAAiB;MACtDK,MAAM,EAAEP,MAAO;MACfD,OAAO,EAAEA,OAAQ;MACjBS,cAAc,EAAE,CAAC,CAACR,MAAO;MACzBS,eAAe,EAAE,CAAC,CAACV,OAAQ;MAC3BW,SAAS,EAAC;IAAQ,CACnB,CAAC,eACFf,IAAA,CAACH,mBAAmB;MAClBO,OAAO,EAAEI,KAAM;MACfQ,YAAY,EAAEA,CAAA,KAAMV,QAAQ,GAAG,SAAS,CAAE;MAC1CW,gBAAgB,EAAEA,CAAA,KAAMX,QAAQ,GAAG,eAAe,CAAE;MACpDY,eAAe,EAAEA,CAAA,KAAMZ,QAAQ,GAAG,eAAe,CAAE;MACnDa,qBAAqB,EAAGC,SAAS,IAAKd,QAAQ,GAAG,iBAAiB,EAAE;QAAEc;MAAU,CAAC;IAAE,CACpF,CAAC;EAAA,CACE,CAAC;AAEX,CAAC;AAED,eAAejB,qBAAqB","ignoreList":[]}
@@ -1,306 +0,0 @@
1
- "use strict";
2
-
3
- /**
4
- * OxyAuthScreen — Sign in with Oxy (native bottom-sheet container).
5
- *
6
- * Two phases, Google-style:
7
- * 1. Account chooser (FRONT screen, shown when the device/user already has
8
- * accounts): pick an account to continue as — one tap switches through the
9
- * SAME `switchToAccount` path the account switcher uses — or "Use another
10
- * account" to reveal the sign-in options.
11
- * 2. Sign-in options: the first-party password flow (identifier → password →
12
- * optional 2FA, `usePasswordSignIn`) as the PRIMARY action, with the
13
- * cross-app device flow (same-device deep-link + "sign in on another device"
14
- * QR) as a SECONDARY option below an "or" divider.
15
- *
16
- * The device-flow machinery lives in the shared `useOxyAuthSession` hook (the
17
- * web `SignInModal` consumes it too). This screen should NOT be used within the
18
- * Oxy Accounts app itself.
19
- */
20
-
21
- import { useCallback, useState } from 'react';
22
- import { View, TextInput, Linking } from 'react-native';
23
- import { useTheme } from '@oxyhq/bloom/theme';
24
- import { Button } from '@oxyhq/bloom/button';
25
- import { Loading } from '@oxyhq/bloom/loading';
26
- import { H4, Text } from '@oxyhq/bloom/typography';
27
- import { IconCircle } from '@oxyhq/bloom/icon-circle';
28
- import * as Icons from '@oxyhq/bloom/icons';
29
- import { toast } from '@oxyhq/bloom';
30
- import { isDev, logger as loggerUtil } from '@oxyhq/core';
31
- import { useOxy } from "../context/OxyContext.js";
32
- import OxyLogo from "../components/OxyLogo.js";
33
- import AnotherDeviceQR from "../components/AnotherDeviceQR.js";
34
- import LoadingState from "../components/LoadingState.js";
35
- import SignInAccountChooser from "../components/SignInAccountChooser.js";
36
- import { useSwitchableAccounts } from "../hooks/useSwitchableAccounts.js";
37
- import { useI18n } from "../hooks/useI18n.js";
38
- import { useOxyAuthSession, OXY_ACCOUNTS_WEB_URL } from "../hooks/useOxyAuthSession.js";
39
- import { usePasswordSignIn } from "../hooks/usePasswordSignIn.js";
40
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
41
- const OxyAuthScreen = ({
42
- goBack,
43
- onAuthenticated
44
- }) => {
45
- const bloomTheme = useTheme();
46
- const {
47
- oxyServices,
48
- handleWebSession,
49
- clientId,
50
- switchToAccount
51
- } = useOxy();
52
- const {
53
- t
54
- } = useI18n();
55
- const {
56
- accounts
57
- } = useSwitchableAccounts();
58
- const [useAnother, setUseAnother] = useState(false);
59
- const [switchingId, setSwitchingId] = useState(null);
60
- const showChooser = !useAnother && accounts.length > 0;
61
- const {
62
- qrData,
63
- qrPayload,
64
- isLoading,
65
- error,
66
- isWaiting,
67
- openSameDeviceApproval,
68
- retry
69
- } = useOxyAuthSession(oxyServices, clientId, handleWebSession, {
70
- onSignedIn: onAuthenticated
71
- });
72
- const pw = usePasswordSignIn({
73
- onSignedIn: onAuthenticated
74
- });
75
- const handleSelectAccount = useCallback(async account => {
76
- if (account.isCurrent) {
77
- onAuthenticated?.();
78
- return;
79
- }
80
- if (switchingId) return;
81
- setSwitchingId(account.accountId);
82
- try {
83
- await switchToAccount(account.accountId);
84
- onAuthenticated?.();
85
- } catch (switchError) {
86
- if (isDev()) {
87
- loggerUtil.warn('OxyAuthScreen: switch account failed', {
88
- component: 'OxyAuthScreen'
89
- }, switchError);
90
- }
91
- toast.error(t('accountSwitcher.toasts.switchFailed') || 'Failed to switch account');
92
- } finally {
93
- setSwitchingId(null);
94
- }
95
- }, [switchingId, switchToAccount, onAuthenticated, t]);
96
- const inputStyle = {
97
- width: '100%',
98
- borderWidth: 1,
99
- borderRadius: 12,
100
- paddingHorizontal: 16,
101
- paddingVertical: 13,
102
- fontSize: 15,
103
- marginBottom: 12,
104
- borderColor: bloomTheme.colors.border,
105
- color: bloomTheme.colors.text,
106
- backgroundColor: bloomTheme.colors.backgroundSecondary
107
- };
108
- const title = showChooser ? t('signin.chooser.title') : 'Sign in to Oxy';
109
- const subtitle = showChooser ? t('signin.chooser.subtitle') : 'Continue with your Oxy identity to sign in securely';
110
- return /*#__PURE__*/_jsxs(View, {
111
- className: "flex-1 items-center justify-center bg-bg px-screen-margin",
112
- children: [/*#__PURE__*/_jsxs(View, {
113
- className: "items-center mb-space-24 gap-space-12",
114
- children: [/*#__PURE__*/_jsx(OxyLogo, {
115
- variant: "icon",
116
- size: 52
117
- }), /*#__PURE__*/_jsx(H4, {
118
- className: "text-headerBold font-headerBold text-text text-center",
119
- children: title
120
- }), /*#__PURE__*/_jsx(Text, {
121
- className: "font-sans text-body text-text-secondary text-center",
122
- children: subtitle
123
- })]
124
- }), showChooser ? /*#__PURE__*/_jsx(SignInAccountChooser, {
125
- accounts: accounts,
126
- onSelectAccount: handleSelectAccount,
127
- onUseAnother: () => setUseAnother(true),
128
- pendingAccountId: switchingId,
129
- disabled: switchingId !== null
130
- }) : /*#__PURE__*/_jsxs(_Fragment, {
131
- children: [accounts.length > 0 && /*#__PURE__*/_jsx(Button, {
132
- variant: "text",
133
- size: "small",
134
- className: "self-start mb-space-8",
135
- onPress: () => setUseAnother(false),
136
- accessibilityLabel: "Choose an account",
137
- icon: /*#__PURE__*/_jsx(Icons.ArrowLeft_Stroke2_Corner0_Rounded, {
138
- size: "sm",
139
- style: {
140
- color: bloomTheme.colors.textSecondary
141
- }
142
- }),
143
- children: "Choose an account"
144
- }), /*#__PURE__*/_jsxs(View, {
145
- className: "w-full",
146
- children: [pw.step === 'identifier' && /*#__PURE__*/_jsx(TextInput, {
147
- style: inputStyle,
148
- value: pw.identifier,
149
- onChangeText: pw.setIdentifier,
150
- onSubmitEditing: pw.submitIdentifier,
151
- placeholder: "Username or email",
152
- placeholderTextColor: bloomTheme.colors.textSecondary,
153
- autoCapitalize: "none",
154
- autoCorrect: false,
155
- keyboardType: "email-address",
156
- returnKeyType: "next",
157
- accessibilityLabel: "Username or email"
158
- }), pw.step === 'password' && /*#__PURE__*/_jsxs(_Fragment, {
159
- children: [/*#__PURE__*/_jsx(Text, {
160
- className: "font-sans text-body text-text-secondary text-center mb-space-12",
161
- children: pw.identifier
162
- }), /*#__PURE__*/_jsx(TextInput, {
163
- style: inputStyle,
164
- value: pw.password,
165
- onChangeText: pw.setPassword,
166
- onSubmitEditing: pw.submitPassword,
167
- placeholder: "Password",
168
- placeholderTextColor: bloomTheme.colors.textSecondary,
169
- secureTextEntry: true,
170
- autoCapitalize: "none",
171
- autoCorrect: false,
172
- returnKeyType: "go",
173
- accessibilityLabel: "Password"
174
- })]
175
- }), pw.step === 'twoFactor' && /*#__PURE__*/_jsx(TextInput, {
176
- style: inputStyle,
177
- value: pw.code,
178
- onChangeText: pw.setCode,
179
- onSubmitEditing: pw.submitTwoFactor,
180
- placeholder: pw.useBackupCode ? 'Backup code' : '6-digit code',
181
- placeholderTextColor: bloomTheme.colors.textSecondary,
182
- autoCapitalize: "none",
183
- autoCorrect: false,
184
- keyboardType: pw.useBackupCode ? 'default' : 'number-pad',
185
- returnKeyType: "go",
186
- accessibilityLabel: pw.useBackupCode ? 'Backup code' : 'Two-factor code'
187
- }), /*#__PURE__*/_jsx(Button, {
188
- variant: "primary",
189
- size: "large",
190
- fullWidth: true,
191
- className: "w-full",
192
- onPress: pw.step === 'identifier' ? pw.submitIdentifier : pw.step === 'password' ? pw.submitPassword : pw.submitTwoFactor,
193
- loading: pw.isSubmitting,
194
- disabled: pw.isSubmitting,
195
- children: pw.step === 'identifier' ? 'Continue' : pw.step === 'password' ? 'Sign in' : 'Verify'
196
- }), pw.error && /*#__PURE__*/_jsx(Text, {
197
- className: "font-sans text-body text-destructive text-center mt-space-12",
198
- children: pw.error
199
- }), pw.step === 'twoFactor' && /*#__PURE__*/_jsx(Button, {
200
- variant: "text",
201
- size: "small",
202
- className: "mt-space-8",
203
- onPress: () => pw.setUseBackupCode(!pw.useBackupCode),
204
- children: pw.useBackupCode ? 'Use authenticator code' : 'Use a backup code'
205
- }), pw.step !== 'identifier' && /*#__PURE__*/_jsx(Button, {
206
- variant: "text",
207
- size: "small",
208
- className: "mt-space-8",
209
- onPress: pw.back,
210
- accessibilityLabel: "Back",
211
- children: "Back"
212
- })]
213
- }), /*#__PURE__*/_jsxs(View, {
214
- className: "flex-row items-center w-full my-space-16 gap-space-8",
215
- children: [/*#__PURE__*/_jsx(View, {
216
- className: "flex-1",
217
- style: {
218
- height: 1,
219
- backgroundColor: bloomTheme.colors.border
220
- }
221
- }), /*#__PURE__*/_jsx(Text, {
222
- className: "font-sans text-caption text-text-tertiary",
223
- children: "or"
224
- }), /*#__PURE__*/_jsx(View, {
225
- className: "flex-1",
226
- style: {
227
- height: 1,
228
- backgroundColor: bloomTheme.colors.border
229
- }
230
- })]
231
- }), isLoading ? /*#__PURE__*/_jsx(LoadingState, {
232
- size: "small",
233
- color: bloomTheme.colors.primary,
234
- message: "Preparing sign in\u2026"
235
- }) : error ? /*#__PURE__*/_jsxs(View, {
236
- className: "items-center gap-space-16 w-full",
237
- children: [/*#__PURE__*/_jsx(IconCircle, {
238
- icon: Icons.Warning_Stroke2_Corner0_Rounded
239
- }), /*#__PURE__*/_jsx(Text, {
240
- className: "font-sans text-body text-text-secondary text-center",
241
- children: error
242
- }), /*#__PURE__*/_jsx(Button, {
243
- variant: "secondary",
244
- fullWidth: true,
245
- className: "w-full",
246
- onPress: retry,
247
- icon: /*#__PURE__*/_jsx(Icons.ArrowRotateClockwise_Stroke2_Corner0_Rounded, {
248
- size: "sm",
249
- style: {
250
- color: bloomTheme.colors.text
251
- }
252
- }),
253
- children: "Try Again"
254
- })]
255
- }) : /*#__PURE__*/_jsxs(_Fragment, {
256
- children: [qrPayload && /*#__PURE__*/_jsx(Button, {
257
- variant: "secondary",
258
- size: "large",
259
- fullWidth: true,
260
- className: "w-full",
261
- onPress: openSameDeviceApproval,
262
- icon: /*#__PURE__*/_jsx(OxyLogo, {
263
- variant: "icon",
264
- size: 20,
265
- fillColor: bloomTheme.colors.text
266
- }),
267
- children: "Sign in with the Oxy app"
268
- }), isWaiting && /*#__PURE__*/_jsxs(View, {
269
- className: "flex-row items-center mt-space-16 gap-space-8",
270
- children: [/*#__PURE__*/_jsx(Loading, {
271
- size: "small"
272
- }), /*#__PURE__*/_jsx(Text, {
273
- className: "font-sans text-body text-text-secondary",
274
- children: "Waiting for authorization\u2026"
275
- })]
276
- }), /*#__PURE__*/_jsx(View, {
277
- className: "w-full mt-space-24",
278
- children: /*#__PURE__*/_jsx(AnotherDeviceQR, {
279
- qrData: qrData,
280
- qrPayload: qrPayload
281
- })
282
- })]
283
- })]
284
- }), /*#__PURE__*/_jsxs(View, {
285
- className: "flex-row flex-wrap justify-center items-center mt-space-24",
286
- children: [/*#__PURE__*/_jsx(Text, {
287
- className: "font-sans text-body text-text-secondary",
288
- children: "Don't have an Oxy account?"
289
- }), /*#__PURE__*/_jsx(Button, {
290
- variant: "text",
291
- size: "small",
292
- onPress: () => Linking.openURL(OXY_ACCOUNTS_WEB_URL),
293
- accessibilityLabel: "Create an Oxy account",
294
- children: "Create one"
295
- })]
296
- }), goBack && /*#__PURE__*/_jsx(Button, {
297
- variant: "text",
298
- onPress: goBack,
299
- className: "mt-space-8",
300
- accessibilityLabel: "Cancel",
301
- children: "Cancel"
302
- })]
303
- });
304
- };
305
- export default OxyAuthScreen;
306
- //# sourceMappingURL=OxyAuthScreen.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["useCallback","useState","View","TextInput","Linking","useTheme","Button","Loading","H4","Text","IconCircle","Icons","toast","isDev","logger","loggerUtil","useOxy","OxyLogo","AnotherDeviceQR","LoadingState","SignInAccountChooser","useSwitchableAccounts","useI18n","useOxyAuthSession","OXY_ACCOUNTS_WEB_URL","usePasswordSignIn","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","OxyAuthScreen","goBack","onAuthenticated","bloomTheme","oxyServices","handleWebSession","clientId","switchToAccount","t","accounts","useAnother","setUseAnother","switchingId","setSwitchingId","showChooser","length","qrData","qrPayload","isLoading","error","isWaiting","openSameDeviceApproval","retry","onSignedIn","pw","handleSelectAccount","account","isCurrent","accountId","switchError","warn","component","inputStyle","width","borderWidth","borderRadius","paddingHorizontal","paddingVertical","fontSize","marginBottom","borderColor","colors","border","color","text","backgroundColor","backgroundSecondary","title","subtitle","className","children","variant","size","onSelectAccount","onUseAnother","pendingAccountId","disabled","onPress","accessibilityLabel","icon","ArrowLeft_Stroke2_Corner0_Rounded","style","textSecondary","step","value","identifier","onChangeText","setIdentifier","onSubmitEditing","submitIdentifier","placeholder","placeholderTextColor","autoCapitalize","autoCorrect","keyboardType","returnKeyType","password","setPassword","submitPassword","secureTextEntry","code","setCode","submitTwoFactor","useBackupCode","fullWidth","loading","isSubmitting","setUseBackupCode","back","height","primary","message","Warning_Stroke2_Corner0_Rounded","ArrowRotateClockwise_Stroke2_Corner0_Rounded","fillColor","openURL"],"sourceRoot":"../../../../src","sources":["ui/screens/OxyAuthScreen.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,WAAW,EAAEC,QAAQ,QAAQ,OAAO;AAC7C,SAASC,IAAI,EAAEC,SAAS,EAAEC,OAAO,QAAwB,cAAc;AAEvE,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,MAAM,QAAQ,qBAAqB;AAC5C,SAASC,OAAO,QAAQ,sBAAsB;AAC9C,SAASC,EAAE,EAAEC,IAAI,QAAQ,yBAAyB;AAClD,SAASC,UAAU,QAAQ,0BAA0B;AACrD,OAAO,KAAKC,KAAK,MAAM,oBAAoB;AAC3C,SAASC,KAAK,QAAQ,cAAc;AACpC,SAASC,KAAK,EAAEC,MAAM,IAAIC,UAAU,QAAQ,aAAa;AACzD,SAASC,MAAM,QAAQ,0BAAuB;AAC9C,OAAOC,OAAO,MAAM,0BAAuB;AAC3C,OAAOC,eAAe,MAAM,kCAA+B;AAC3D,OAAOC,YAAY,MAAM,+BAA4B;AACrD,OAAOC,oBAAoB,MAAM,uCAAoC;AACrE,SAASC,qBAAqB,QAAgC,mCAAgC;AAC9F,SAASC,OAAO,QAAQ,qBAAkB;AAC1C,SAASC,iBAAiB,EAAEC,oBAAoB,QAAQ,+BAA4B;AACpF,SAASC,iBAAiB,QAAQ,+BAA4B;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAE/D,MAAMC,aAAwC,GAAGA,CAAC;EAAEC,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AA,KAAMrF,OAAO,CAAC2H,OAAO,CAACvG,oBAAoB,CAAE;QACrDkE,kBAAkB,EAAC,uBAAuB;QAAAR,QAAA,EAC3C;MAED,CAAQ,CAAC;IAAA,CACL,CAAC,EAGNjD,MAAM,iBACLN,IAAA,CAACrB,MAAM;MAAC6E,OAAO,EAAC,MAAM;MAACM,OAAO,EAAExD,MAAO;MAACgD,SAAS,EAAC,YAAY;MAACS,kBAAkB,EAAC,QAAQ;MAAAR,QAAA,EAAC;IAE3F,CAAQ,CACT;EAAA,CACG,CAAC;AAEX,CAAC;AAED,eAAelD,aAAa","ignoreList":[]}
@@ -1,106 +0,0 @@
1
- "use strict";
2
-
3
- /**
4
- * Shared, pure orchestration for completing the cross-app device-flow sign-in
5
- * (the QR-code / "Open Oxy Auth" path used on native and web).
6
- *
7
- * THE FIRST BUG THIS FIXES (native): once another authenticated device
8
- * approves the pending AuthSession, the originating client is notified
9
- * (socket / poll / deep-link) with the authorized `sessionId`. Before any
10
- * session-management code can use it, the client MUST exchange the secret
11
- * 128-bit `sessionToken` (held only by this client, generated for THIS flow)
12
- * for the first access token via `claimSessionByToken` — the device-flow
13
- * equivalent of OAuth's code-for-token exchange (RFC 8628 §3.4).
14
- *
15
- * THE SECOND BUG THIS FIXES (session-sync cutover regression): the
16
- * freshly-claimed session is NOT yet registered in the device's
17
- * server-authoritative session set — nothing has run
18
- * `sessionClient.addCurrentAccount()` for it — so it must NOT be committed
19
- * through `switchSession`. That path is now an account-SWITCH between
20
- * accounts already registered on this device (`OxyContext`'s
21
- * `switchSessionForContext`), and throws `No device account found for
22
- * session "..."` for anything else, surfacing as "Authorization successful
23
- * but failed to complete sign in." Instead the claimed session must be
24
- * committed through the SAME path a fresh password sign-in uses —
25
- * `useOxy().handleWebSession` (`OxyContext`'s `handleWebSSOSession`) — which
26
- * registers the account into the device set, persists it durably, and
27
- * hydrates the full user profile.
28
- *
29
- * Skipping the claim leaves the SDK with NO bearer token: the session is
30
- * authorized server-side but the app never becomes authenticated and the UI
31
- * sits "Waiting for authorization..." forever. Consolidating the
32
- * claim->commit sequence here keeps native and web identical and
33
- * unit-testable.
34
- */
35
-
36
- import { KeyManager } from '@oxyhq/core';
37
-
38
- /**
39
- * The minimal `OxyServices` surface this orchestration needs. Kept as a
40
- * structural type (rather than importing the full client) so the helper is
41
- * trivially unit-testable with a stub and never pulls the RN/Expo runtime into
42
- * a test bundle.
43
- *
44
- */
45
-
46
- /**
47
- * Complete a device-flow sign-in: claim the first access token with the secret
48
- * `sessionToken` (planting the bearer), then commit the resulting session via
49
- * `commitSession` (registers it into the device's server-authoritative session
50
- * set and hydrates the full user). Returns the authenticated user.
51
- *
52
- * Throws if the claim did not return a usable session, or if either the claim
53
- * or the commit fails; callers surface a retry UI.
54
- */
55
- export async function completeDeviceFlowSignIn({
56
- oxyServices,
57
- sessionId,
58
- sessionToken,
59
- commitSession
60
- }) {
61
- // 1) Plant the bearer + refresh tokens. The claim response is also persisted
62
- // to native shared secure storage so a later cold boot has a bearer before
63
- // it validates stored sessions. On web this is a no-op.
64
- const claimed = await oxyServices.claimSessionByToken(sessionToken);
65
- if (claimed?.accessToken) {
66
- await KeyManager.storeSharedSession(claimed.sessionId || sessionId, claimed.accessToken);
67
- }
68
- if (!claimed?.accessToken || !claimed.user) {
69
- throw new Error('Device-flow claim did not return a usable session');
70
- }
71
-
72
- // `SessionLoginResponse.user` is the minimal session-carried shape (avatar
73
- // is `string | undefined`); the claim response returns the full `User`
74
- // (avatar is `string | null | undefined`). Normalize rather than widening
75
- // `SessionLoginResponse.user` to accept `null`.
76
- const minimalUser = {
77
- id: claimed.user.id,
78
- username: claimed.user.username,
79
- name: claimed.user.name,
80
- avatar: claimed.user.avatar ?? undefined
81
- };
82
-
83
- // 2) Bearer is now planted — commit the session through the same path a
84
- // fresh sign-in uses so it is registered into the device's
85
- // server-authoritative session set instead of an account switch. Thread
86
- // the rotating refresh token so the commit funnel persists a durable
87
- // session that survives a reload.
88
- await commitSession({
89
- sessionId: claimed.sessionId || sessionId,
90
- deviceId: claimed.deviceId ?? '',
91
- expiresAt: claimed.expiresAt ?? '',
92
- user: minimalUser,
93
- accessToken: claimed.accessToken,
94
- ...(claimed.refreshToken ? {
95
- refreshToken: claimed.refreshToken
96
- } : {})
97
- });
98
-
99
- // The commit funnel persisted the rotating refresh family and registered the
100
- // account into the device set, so a reload restores the session locally (web:
101
- // stored-tokens / same-apex web-session; native: shared keychain) WITHOUT any
102
- // IdP `fedcm_session` cookie or top-level establish hop.
103
-
104
- return claimed.user;
105
- }
106
- //# sourceMappingURL=deviceFlowSignIn.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["KeyManager","completeDeviceFlowSignIn","oxyServices","sessionId","sessionToken","commitSession","claimed","claimSessionByToken","accessToken","storeSharedSession","user","Error","minimalUser","id","username","name","avatar","undefined","deviceId","expiresAt","refreshToken"],"sourceRoot":"../../../src","sources":["utils/deviceFlowSignIn.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,UAAU,QAIL,aAAa;;AAepB;AACA;AACA;AACA;AACA;AACA;AACA;;AAkCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,wBAAwBA,CAAC;EAC7CC,WAAW;EACXC,SAAS;EACTC,YAAY;EACZC;AAC+B,CAAC,EAAiB;EACjD;EACA;EACA;EACA,MAAMC,OAAO,GAAG,MAAMJ,WAAW,CAACK,mBAAmB,CAACH,YAAY,CAAC;EACnE,IAAIE,OAAO,EAAEE,WAAW,EAAE;IACxB,MAAMR,UAAU,CAACS,kBAAkB,CAACH,OAAO,CAACH,SAAS,IAAIA,SAAS,EAAEG,OAAO,CAACE,WAAW,CAAC;EAC1F;EAEA,IAAI,CAACF,OAAO,EAAEE,WAAW,IAAI,CAACF,OAAO,CAACI,IAAI,EAAE;IAC1C,MAAM,IAAIC,KAAK,CAAC,mDAAmD,CAAC;EACtE;;EAEA;EACA;EACA;EACA;EACA,MAAMC,WAA4B,GAAG;IACnCC,EAAE,EAAEP,OAAO,CAACI,IAAI,CAACG,EAAE;IACnBC,QAAQ,EAAER,OAAO,CAACI,IAAI,CAACI,QAAQ;IAC/BC,IAAI,EAAET,OAAO,CAACI,IAAI,CAACK,IAAI;IACvBC,MAAM,EAAEV,OAAO,CAACI,IAAI,CAACM,MAAM,IAAIC;EACjC,CAAC;;EAED;EACA;EACA;EACA;EACA;EACA,MAAMZ,aAAa,CAAC;IAClBF,SAAS,EAAEG,OAAO,CAACH,SAAS,IAAIA,SAAS;IACzCe,QAAQ,EAAEZ,OAAO,CAACY,QAAQ,IAAI,EAAE;IAChCC,SAAS,EAAEb,OAAO,CAACa,SAAS,IAAI,EAAE;IAClCT,IAAI,EAAEE,WAAW;IACjBJ,WAAW,EAAEF,OAAO,CAACE,WAAW;IAChC,IAAIF,OAAO,CAACc,YAAY,GAAG;MAAEA,YAAY,EAAEd,OAAO,CAACc;IAAa,CAAC,GAAG,CAAC,CAAC;EACxE,CAAC,CAAC;;EAEF;EACA;EACA;EACA;;EAEA,OAAOd,OAAO,CAACI,IAAI;AACrB","ignoreList":[]}
@@ -1,47 +0,0 @@
1
- import type React from 'react';
2
- /**
3
- * Web-only anchor for the popover panel. Each field anchors the panel against
4
- * one viewport edge, so the popover can be placed against ANY corner: a
5
- * top-right avatar chip opens downward/right-aligned (`{ top, right }`), while a
6
- * bottom-left account button opens upward/left-aligned (`{ bottom, left }`).
7
- *
8
- * Callers MUST supply at most one vertical edge (`top` XOR `bottom`) and at most
9
- * one horizontal edge (`left` XOR `right`). The panel has a fixed width and
10
- * `maxHeight`, so a single vertical + single horizontal edge fully positions it.
11
- * Supplying both opposite edges (e.g. `top` AND `bottom`) would stretch the
12
- * panel on RN-Web and is unsupported.
13
- */
14
- export interface AccountMenuAnchor {
15
- /** Distance from the viewport top, when anchoring the panel's TOP edge. */
16
- top?: number;
17
- /** Distance from the viewport bottom, when anchoring the panel's BOTTOM edge (opens upward). */
18
- bottom?: number;
19
- /** Distance from the viewport left, when anchoring the panel's LEFT edge. */
20
- left?: number;
21
- /** Distance from the viewport right, when anchoring the panel's RIGHT edge. */
22
- right?: number;
23
- }
24
- export interface AccountMenuProps {
25
- open: boolean;
26
- onClose: () => void;
27
- onNavigateManage: () => void;
28
- onAddAccount: () => void;
29
- /** Optional anchor (web only). Native ignores this and uses bottom-sheet style. */
30
- anchor?: AccountMenuAnchor | null;
31
- /** Called before the active identity changes so apps can clear tenant-scoped state. */
32
- onBeforeSessionChange?: () => void | Promise<void>;
33
- }
34
- /**
35
- * Unified, canonical account switcher for the Oxy ecosystem. Gmail-style: the
36
- * accounts list sits at the top (current account first, with a checkmark), then
37
- * "Add another account", "Manage account", and the sign-out actions. Lists EVERY
38
- * switchable account (device sign-ins AND linked graph accounts) and routes every
39
- * switch through the single `switchToAccount(accountId)` path.
40
- *
41
- * Reads everything it needs from `useOxy()` / `useSwitchableAccounts()` — never
42
- * receives a session via props. Renders as a popover anchored to the trigger on
43
- * web, and as a full-width bottom-sheet style modal on native.
44
- */
45
- declare const AccountMenu: React.FC<AccountMenuProps>;
46
- export default AccountMenu;
47
- //# sourceMappingURL=AccountMenu.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AccountMenu.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/AccountMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAwB/B;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,iBAAiB;IAC9B,2EAA2E;IAC3E,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,gGAAgG;IAChG,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,6EAA6E;IAC7E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,+EAA+E;IAC/E,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC7B,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,mFAAmF;IACnF,MAAM,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAClC,uFAAuF;IACvF,qBAAqB,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACtD;AAQD;;;;;;;;;;GAUG;AACH,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA8b3C,CAAC;AA2HF,eAAe,WAAW,CAAC"}
@@ -1,26 +0,0 @@
1
- import type React from 'react';
2
- export interface AccountMenuButtonProps {
3
- /** Avatar size (px). Defaults to 36 (Google account chip size). */
4
- size?: number;
5
- /** Called when the user picks "Manage your Oxy Account". */
6
- onNavigateManage: () => void;
7
- /** Called when the user picks "Add another account". */
8
- onAddAccount: () => void;
9
- }
10
- /**
11
- * Avatar entry-point that opens the unified {@link AccountSwitcher}. Reads the
12
- * active account from `useOxy().user` — never receives user data via props.
13
- *
14
- * The chip reflects the current account: in the real-session switch model,
15
- * switching into an org / project / bot / shared account makes the whole app —
16
- * including this header avatar — become that account, so `user` IS the current
17
- * account and the chip always shows it.
18
- *
19
- * Renders a small avatar chip (top-right friendly). Click → opens the switcher
20
- * (device sign-ins + account graph). Pure component: owns only the open-state
21
- * and the trigger's measured anchor. Create-account and per-account settings
22
- * route through the global bottom-sheet manager.
23
- */
24
- declare const AccountMenuButton: React.FC<AccountMenuButtonProps>;
25
- export default AccountMenuButton;
26
- //# sourceMappingURL=AccountMenuButton.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AccountMenuButton.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/AccountMenuButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,MAAM,WAAW,sBAAsB;IACnC,mEAAmE;IACnE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4DAA4D;IAC5D,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,wDAAwD;IACxD,YAAY,EAAE,MAAM,IAAI,CAAC;CAC5B;AAID;;;;;;;;;;;;;GAaG;AACH,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CA+EvD,CAAC;AAUF,eAAe,iBAAiB,CAAC"}
@@ -1,46 +0,0 @@
1
- import type React from 'react';
2
- import type { AccountMenuAnchor } from './AccountMenu';
3
- /**
4
- * The set of action callbacks the switcher body needs. Supplied by whichever
5
- * chrome wraps it — the {@link AccountSwitcher} modal/popover (web header chip,
6
- * native sheet) or the {@link AccountSwitcherScreen} bottom-sheet route.
7
- */
8
- export interface AccountSwitcherActions {
9
- /** Close the surface (dismiss the modal, or pop the bottom sheet). */
10
- onClose: () => void;
11
- /** Start adding another device sign-in. */
12
- onAddAccount: () => void;
13
- /** Open "Manage your Oxy Account" (the caller's own personal account). */
14
- onNavigateManage: () => void;
15
- /** Open the create-account flow. */
16
- onCreateAccount: () => void;
17
- /** Open the per-account settings surface for a non-personal account. */
18
- onOpenAccountSettings?: (accountId: string) => void;
19
- /** Called before the active device session changes so apps can clear tenant state. */
20
- onBeforeSessionChange?: () => void | Promise<void>;
21
- }
22
- /**
23
- * The presentational, chrome-agnostic body of the unified account switcher.
24
- *
25
- * Two levels, relationship-aware, both sourced from the single
26
- * {@link useSwitchableAccounts} hook and switched through the SINGLE
27
- * `switchToAccount(accountId)` path:
28
- * - Section A — accounts signed in on THIS device (`onDevice` rows). Tap to
29
- * switch; per-row sign-out; "Add another account".
30
- * - Section B — the account GRAPH not yet signed in here: "Your accounts"
31
- * (self / owned) and "Shared with you" (member). 2-level tree (org →
32
- * children), role badge, search, one-tap to switch.
33
- */
34
- export declare const AccountSwitcherView: React.FC<AccountSwitcherActions>;
35
- export interface AccountSwitcherProps extends AccountSwitcherActions {
36
- open: boolean;
37
- /** Optional anchor (web only). Native ignores this and docks as a bottom sheet. */
38
- anchor?: AccountMenuAnchor | null;
39
- }
40
- /**
41
- * Unified account switcher presented as a popover (web) / bottom-sheet style
42
- * modal (native). The canonical entry point opened by {@link AccountMenuButton}.
43
- */
44
- declare const AccountSwitcher: React.FC<AccountSwitcherProps>;
45
- export default AccountSwitcher;
46
- //# sourceMappingURL=AccountSwitcher.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AccountSwitcher.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/AccountSwitcher.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAwB/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAKvD;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACnC,sEAAsE;IACtE,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,2CAA2C;IAC3C,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,0EAA0E;IAC1E,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,oCAAoC;IACpC,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,wEAAwE;IACxE,qBAAqB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACpD,sFAAsF;IACtF,qBAAqB,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACtD;AAyCD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAwbhE,CAAC;AAEF,MAAM,WAAW,oBAAqB,SAAQ,sBAAsB;IAChE,IAAI,EAAE,OAAO,CAAC;IACd,mFAAmF;IACnF,MAAM,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC;CACrC;AAED;;;GAGG;AACH,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAyDnD,CAAC;AA6IF,eAAe,eAAe,CAAC"}