@oxyhq/services 14.1.0 → 16.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 (292) hide show
  1. package/lib/commonjs/index.js +4 -21
  2. package/lib/commonjs/index.js.map +1 -1
  3. package/lib/commonjs/ui/components/SignInAccountChooser.js +189 -0
  4. package/lib/commonjs/ui/components/SignInAccountChooser.js.map +1 -0
  5. package/lib/commonjs/ui/components/SignInModal.js +350 -131
  6. package/lib/commonjs/ui/components/SignInModal.js.map +1 -1
  7. package/lib/commonjs/ui/context/OxyContext.js +340 -1547
  8. package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
  9. package/lib/commonjs/ui/context/hooks/useAuthOperations.js +61 -64
  10. package/lib/commonjs/ui/context/hooks/useAuthOperations.js.map +1 -1
  11. package/lib/commonjs/ui/hooks/mutations/mutationKeys.js +1 -1
  12. package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js +9 -9
  13. package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js.map +1 -1
  14. package/lib/commonjs/ui/hooks/queries/queryKeys.js +1 -1
  15. package/lib/commonjs/ui/hooks/queries/useAccountQueries.js +7 -8
  16. package/lib/commonjs/ui/hooks/queries/useAccountQueries.js.map +1 -1
  17. package/lib/commonjs/ui/hooks/useAuth.js +14 -33
  18. package/lib/commonjs/ui/hooks/useAuth.js.map +1 -1
  19. package/lib/commonjs/ui/hooks/usePasswordSignIn.js +170 -0
  20. package/lib/commonjs/ui/hooks/usePasswordSignIn.js.map +1 -0
  21. package/lib/commonjs/ui/hooks/useProfileEditing.js +2 -5
  22. package/lib/commonjs/ui/hooks/useProfileEditing.js.map +1 -1
  23. package/lib/commonjs/ui/hooks/useSessionManagement.js +2 -2
  24. package/lib/commonjs/ui/hooks/useSessionManagement.js.map +1 -1
  25. package/lib/commonjs/ui/navigation/routes.js +1 -0
  26. package/lib/commonjs/ui/navigation/routes.js.map +1 -1
  27. package/lib/commonjs/ui/screens/ConnectedAppsScreen.js +17 -18
  28. package/lib/commonjs/ui/screens/ConnectedAppsScreen.js.map +1 -1
  29. package/lib/commonjs/ui/screens/EditProfileFieldScreen.js +93 -68
  30. package/lib/commonjs/ui/screens/EditProfileFieldScreen.js.map +1 -1
  31. package/lib/commonjs/ui/screens/EditProfileScreen.js +187 -0
  32. package/lib/commonjs/ui/screens/EditProfileScreen.js.map +1 -0
  33. package/lib/commonjs/ui/screens/ManageAccountScreen.js +3 -7
  34. package/lib/commonjs/ui/screens/ManageAccountScreen.js.map +1 -1
  35. package/lib/commonjs/ui/screens/OxyAuthScreen.js +231 -95
  36. package/lib/commonjs/ui/screens/OxyAuthScreen.js.map +1 -1
  37. package/lib/commonjs/ui/screens/ProfileScreen.js +15 -2
  38. package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
  39. package/lib/commonjs/ui/screens/linkFormat.js +38 -0
  40. package/lib/commonjs/ui/screens/linkFormat.js.map +1 -0
  41. package/lib/commonjs/ui/session/authStore.js +146 -0
  42. package/lib/commonjs/ui/session/authStore.js.map +1 -0
  43. package/lib/commonjs/ui/session/createSessionClient.js +23 -17
  44. package/lib/commonjs/ui/session/createSessionClient.js.map +1 -1
  45. package/lib/commonjs/ui/session/index.js +13 -7
  46. package/lib/commonjs/ui/session/index.js.map +1 -1
  47. package/lib/commonjs/ui/session/tokenTransport.js +19 -31
  48. package/lib/commonjs/ui/session/tokenTransport.js.map +1 -1
  49. package/lib/commonjs/ui/utils/isWebBrowser.js +13 -0
  50. package/lib/commonjs/ui/utils/isWebBrowser.js.map +1 -0
  51. package/lib/commonjs/utils/deviceFlowSignIn.js +13 -16
  52. package/lib/commonjs/utils/deviceFlowSignIn.js.map +1 -1
  53. package/lib/module/index.js +2 -7
  54. package/lib/module/index.js.map +1 -1
  55. package/lib/module/ui/components/SignInAccountChooser.js +183 -0
  56. package/lib/module/ui/components/SignInAccountChooser.js.map +1 -0
  57. package/lib/module/ui/components/SignInModal.js +352 -134
  58. package/lib/module/ui/components/SignInModal.js.map +1 -1
  59. package/lib/module/ui/context/OxyContext.js +342 -1551
  60. package/lib/module/ui/context/OxyContext.js.map +1 -1
  61. package/lib/module/ui/context/hooks/useAuthOperations.js +60 -63
  62. package/lib/module/ui/context/hooks/useAuthOperations.js.map +1 -1
  63. package/lib/module/ui/hooks/mutations/mutationKeys.js +1 -1
  64. package/lib/module/ui/hooks/mutations/useAccountMutations.js +7 -7
  65. package/lib/module/ui/hooks/mutations/useAccountMutations.js.map +1 -1
  66. package/lib/module/ui/hooks/queries/queryKeys.js +1 -1
  67. package/lib/module/ui/hooks/queries/useAccountQueries.js +5 -6
  68. package/lib/module/ui/hooks/queries/useAccountQueries.js.map +1 -1
  69. package/lib/module/ui/hooks/useAuth.js +14 -33
  70. package/lib/module/ui/hooks/useAuth.js.map +1 -1
  71. package/lib/module/ui/hooks/usePasswordSignIn.js +165 -0
  72. package/lib/module/ui/hooks/usePasswordSignIn.js.map +1 -0
  73. package/lib/module/ui/hooks/useProfileEditing.js +2 -5
  74. package/lib/module/ui/hooks/useProfileEditing.js.map +1 -1
  75. package/lib/module/ui/hooks/useSessionManagement.js +1 -1
  76. package/lib/module/ui/hooks/useSessionManagement.js.map +1 -1
  77. package/lib/module/ui/navigation/routes.js +1 -0
  78. package/lib/module/ui/navigation/routes.js.map +1 -1
  79. package/lib/module/ui/screens/ConnectedAppsScreen.js +19 -20
  80. package/lib/module/ui/screens/ConnectedAppsScreen.js.map +1 -1
  81. package/lib/module/ui/screens/EditProfileFieldScreen.js +91 -66
  82. package/lib/module/ui/screens/EditProfileFieldScreen.js.map +1 -1
  83. package/lib/module/ui/screens/EditProfileScreen.js +182 -0
  84. package/lib/module/ui/screens/EditProfileScreen.js.map +1 -0
  85. package/lib/module/ui/screens/ManageAccountScreen.js +3 -7
  86. package/lib/module/ui/screens/ManageAccountScreen.js.map +1 -1
  87. package/lib/module/ui/screens/OxyAuthScreen.js +233 -97
  88. package/lib/module/ui/screens/OxyAuthScreen.js.map +1 -1
  89. package/lib/module/ui/screens/ProfileScreen.js +15 -2
  90. package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
  91. package/lib/module/ui/screens/linkFormat.js +31 -0
  92. package/lib/module/ui/screens/linkFormat.js.map +1 -0
  93. package/lib/module/ui/session/authStore.js +143 -0
  94. package/lib/module/ui/session/authStore.js.map +1 -0
  95. package/lib/module/ui/session/createSessionClient.js +22 -16
  96. package/lib/module/ui/session/createSessionClient.js.map +1 -1
  97. package/lib/module/ui/session/index.js +9 -9
  98. package/lib/module/ui/session/index.js.map +1 -1
  99. package/lib/module/ui/session/tokenTransport.js +20 -33
  100. package/lib/module/ui/session/tokenTransport.js.map +1 -1
  101. package/lib/module/ui/utils/isWebBrowser.js +11 -0
  102. package/lib/module/ui/utils/isWebBrowser.js.map +1 -0
  103. package/lib/module/utils/deviceFlowSignIn.js +14 -17
  104. package/lib/module/utils/deviceFlowSignIn.js.map +1 -1
  105. package/lib/typescript/commonjs/index.d.ts +2 -3
  106. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  107. package/lib/typescript/commonjs/ui/components/SignInAccountChooser.d.ts +29 -0
  108. package/lib/typescript/commonjs/ui/components/SignInAccountChooser.d.ts.map +1 -0
  109. package/lib/typescript/commonjs/ui/components/SignInModal.d.ts +15 -10
  110. package/lib/typescript/commonjs/ui/components/SignInModal.d.ts.map +1 -1
  111. package/lib/typescript/commonjs/ui/context/OxyContext.d.ts +36 -42
  112. package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
  113. package/lib/typescript/commonjs/ui/context/hooks/useAuthOperations.d.ts +18 -23
  114. package/lib/typescript/commonjs/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
  115. package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts +4 -6
  116. package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
  117. package/lib/typescript/commonjs/ui/hooks/queries/useAccountQueries.d.ts +6 -7
  118. package/lib/typescript/commonjs/ui/hooks/queries/useAccountQueries.d.ts.map +1 -1
  119. package/lib/typescript/commonjs/ui/hooks/useAuth.d.ts.map +1 -1
  120. package/lib/typescript/commonjs/ui/hooks/usePasswordSignIn.d.ts +31 -0
  121. package/lib/typescript/commonjs/ui/hooks/usePasswordSignIn.d.ts.map +1 -0
  122. package/lib/typescript/commonjs/ui/hooks/useProfileEditing.d.ts +0 -1
  123. package/lib/typescript/commonjs/ui/hooks/useProfileEditing.d.ts.map +1 -1
  124. package/lib/typescript/commonjs/ui/navigation/routes.d.ts +1 -1
  125. package/lib/typescript/commonjs/ui/navigation/routes.d.ts.map +1 -1
  126. package/lib/typescript/commonjs/ui/screens/ConnectedAppsScreen.d.ts.map +1 -1
  127. package/lib/typescript/commonjs/ui/screens/EditProfileFieldScreen.d.ts.map +1 -1
  128. package/lib/typescript/commonjs/ui/screens/EditProfileScreen.d.ts +14 -0
  129. package/lib/typescript/commonjs/ui/screens/EditProfileScreen.d.ts.map +1 -0
  130. package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts +1 -1
  131. package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts.map +1 -1
  132. package/lib/typescript/commonjs/ui/screens/OxyAuthScreen.d.ts +13 -12
  133. package/lib/typescript/commonjs/ui/screens/OxyAuthScreen.d.ts.map +1 -1
  134. package/lib/typescript/commonjs/ui/screens/ProfileScreen.d.ts.map +1 -1
  135. package/lib/typescript/commonjs/ui/screens/linkFormat.d.ts +23 -0
  136. package/lib/typescript/commonjs/ui/screens/linkFormat.d.ts.map +1 -0
  137. package/lib/typescript/commonjs/ui/session/authStore.d.ts +33 -0
  138. package/lib/typescript/commonjs/ui/session/authStore.d.ts.map +1 -0
  139. package/lib/typescript/commonjs/ui/session/createSessionClient.d.ts +19 -15
  140. package/lib/typescript/commonjs/ui/session/createSessionClient.d.ts.map +1 -1
  141. package/lib/typescript/commonjs/ui/session/index.d.ts +9 -9
  142. package/lib/typescript/commonjs/ui/session/index.d.ts.map +1 -1
  143. package/lib/typescript/commonjs/ui/session/tokenTransport.d.ts +13 -19
  144. package/lib/typescript/commonjs/ui/session/tokenTransport.d.ts.map +1 -1
  145. package/lib/typescript/commonjs/ui/utils/isWebBrowser.d.ts +9 -0
  146. package/lib/typescript/commonjs/ui/utils/isWebBrowser.d.ts.map +1 -0
  147. package/lib/typescript/commonjs/ui/utils/storageHelpers.d.ts +7 -7
  148. package/lib/typescript/commonjs/utils/deviceFlowSignIn.d.ts +15 -13
  149. package/lib/typescript/commonjs/utils/deviceFlowSignIn.d.ts.map +1 -1
  150. package/lib/typescript/module/index.d.ts +2 -3
  151. package/lib/typescript/module/index.d.ts.map +1 -1
  152. package/lib/typescript/module/ui/components/SignInAccountChooser.d.ts +29 -0
  153. package/lib/typescript/module/ui/components/SignInAccountChooser.d.ts.map +1 -0
  154. package/lib/typescript/module/ui/components/SignInModal.d.ts +15 -10
  155. package/lib/typescript/module/ui/components/SignInModal.d.ts.map +1 -1
  156. package/lib/typescript/module/ui/context/OxyContext.d.ts +36 -42
  157. package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
  158. package/lib/typescript/module/ui/context/hooks/useAuthOperations.d.ts +18 -23
  159. package/lib/typescript/module/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
  160. package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts +4 -6
  161. package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
  162. package/lib/typescript/module/ui/hooks/queries/useAccountQueries.d.ts +6 -7
  163. package/lib/typescript/module/ui/hooks/queries/useAccountQueries.d.ts.map +1 -1
  164. package/lib/typescript/module/ui/hooks/useAuth.d.ts.map +1 -1
  165. package/lib/typescript/module/ui/hooks/usePasswordSignIn.d.ts +31 -0
  166. package/lib/typescript/module/ui/hooks/usePasswordSignIn.d.ts.map +1 -0
  167. package/lib/typescript/module/ui/hooks/useProfileEditing.d.ts +0 -1
  168. package/lib/typescript/module/ui/hooks/useProfileEditing.d.ts.map +1 -1
  169. package/lib/typescript/module/ui/navigation/routes.d.ts +1 -1
  170. package/lib/typescript/module/ui/navigation/routes.d.ts.map +1 -1
  171. package/lib/typescript/module/ui/screens/ConnectedAppsScreen.d.ts.map +1 -1
  172. package/lib/typescript/module/ui/screens/EditProfileFieldScreen.d.ts.map +1 -1
  173. package/lib/typescript/module/ui/screens/EditProfileScreen.d.ts +14 -0
  174. package/lib/typescript/module/ui/screens/EditProfileScreen.d.ts.map +1 -0
  175. package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts +1 -1
  176. package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts.map +1 -1
  177. package/lib/typescript/module/ui/screens/OxyAuthScreen.d.ts +13 -12
  178. package/lib/typescript/module/ui/screens/OxyAuthScreen.d.ts.map +1 -1
  179. package/lib/typescript/module/ui/screens/ProfileScreen.d.ts.map +1 -1
  180. package/lib/typescript/module/ui/screens/linkFormat.d.ts +23 -0
  181. package/lib/typescript/module/ui/screens/linkFormat.d.ts.map +1 -0
  182. package/lib/typescript/module/ui/session/authStore.d.ts +33 -0
  183. package/lib/typescript/module/ui/session/authStore.d.ts.map +1 -0
  184. package/lib/typescript/module/ui/session/createSessionClient.d.ts +19 -15
  185. package/lib/typescript/module/ui/session/createSessionClient.d.ts.map +1 -1
  186. package/lib/typescript/module/ui/session/index.d.ts +9 -9
  187. package/lib/typescript/module/ui/session/index.d.ts.map +1 -1
  188. package/lib/typescript/module/ui/session/tokenTransport.d.ts +13 -19
  189. package/lib/typescript/module/ui/session/tokenTransport.d.ts.map +1 -1
  190. package/lib/typescript/module/ui/utils/isWebBrowser.d.ts +9 -0
  191. package/lib/typescript/module/ui/utils/isWebBrowser.d.ts.map +1 -0
  192. package/lib/typescript/module/ui/utils/storageHelpers.d.ts +7 -7
  193. package/lib/typescript/module/utils/deviceFlowSignIn.d.ts +15 -13
  194. package/lib/typescript/module/utils/deviceFlowSignIn.d.ts.map +1 -1
  195. package/package.json +4 -4
  196. package/src/index.ts +2 -6
  197. package/src/ui/components/SignInAccountChooser.tsx +162 -0
  198. package/src/ui/components/SignInModal.tsx +309 -139
  199. package/src/ui/context/OxyContext.tsx +532 -1785
  200. package/src/ui/context/hooks/useAuthOperations.ts +65 -76
  201. package/src/ui/hooks/mutations/mutationKeys.ts +1 -1
  202. package/src/ui/hooks/mutations/useAccountMutations.ts +7 -7
  203. package/src/ui/hooks/queries/queryKeys.ts +1 -1
  204. package/src/ui/hooks/queries/useAccountQueries.ts +8 -9
  205. package/src/ui/hooks/useAuth.ts +14 -35
  206. package/src/ui/hooks/usePasswordSignIn.ts +207 -0
  207. package/src/ui/hooks/useProfileEditing.ts +2 -8
  208. package/src/ui/hooks/useSessionManagement.ts +1 -1
  209. package/src/ui/navigation/routes.ts +3 -1
  210. package/src/ui/screens/ConnectedAppsScreen.tsx +23 -24
  211. package/src/ui/screens/EditProfileFieldScreen.tsx +102 -66
  212. package/src/ui/screens/EditProfileScreen.tsx +155 -0
  213. package/src/ui/screens/ManageAccountScreen.tsx +3 -7
  214. package/src/ui/screens/OxyAuthScreen.tsx +259 -112
  215. package/src/ui/screens/ProfileScreen.tsx +15 -2
  216. package/src/ui/screens/__tests__/linkFormat.test.ts +73 -0
  217. package/src/ui/screens/linkFormat.ts +37 -0
  218. package/src/ui/session/__tests__/createSessionClient.test.ts +22 -7
  219. package/src/ui/session/__tests__/tokenTransport.test.ts +37 -49
  220. package/src/ui/session/authStore.ts +164 -0
  221. package/src/ui/session/createSessionClient.ts +30 -17
  222. package/src/ui/session/index.ts +10 -9
  223. package/src/ui/session/tokenTransport.ts +26 -36
  224. package/src/ui/utils/isWebBrowser.ts +8 -0
  225. package/src/ui/utils/storageHelpers.ts +7 -7
  226. package/src/utils/__tests__/deviceFlowSignIn.test.ts +50 -131
  227. package/src/utils/deviceFlowSignIn.ts +19 -26
  228. package/lib/commonjs/ui/context/inSessionTokenRefresh.js +0 -243
  229. package/lib/commonjs/ui/context/inSessionTokenRefresh.js.map +0 -1
  230. package/lib/commonjs/ui/context/silentSessionRestore.js +0 -56
  231. package/lib/commonjs/ui/context/silentSessionRestore.js.map +0 -1
  232. package/lib/commonjs/ui/hooks/useWebSSO.js +0 -28
  233. package/lib/commonjs/ui/hooks/useWebSSO.js.map +0 -1
  234. package/lib/commonjs/ui/session/projectSessionState.js +0 -86
  235. package/lib/commonjs/ui/session/projectSessionState.js.map +0 -1
  236. package/lib/commonjs/ui/session/sessionClientHost.js +0 -30
  237. package/lib/commonjs/ui/session/sessionClientHost.js.map +0 -1
  238. package/lib/commonjs/ui/utils/activeAuthuser.js +0 -142
  239. package/lib/commonjs/ui/utils/activeAuthuser.js.map +0 -1
  240. package/lib/commonjs/utils/crossApex.js +0 -74
  241. package/lib/commonjs/utils/crossApex.js.map +0 -1
  242. package/lib/module/ui/context/inSessionTokenRefresh.js +0 -238
  243. package/lib/module/ui/context/inSessionTokenRefresh.js.map +0 -1
  244. package/lib/module/ui/context/silentSessionRestore.js +0 -53
  245. package/lib/module/ui/context/silentSessionRestore.js.map +0 -1
  246. package/lib/module/ui/hooks/useWebSSO.js +0 -24
  247. package/lib/module/ui/hooks/useWebSSO.js.map +0 -1
  248. package/lib/module/ui/session/projectSessionState.js +0 -79
  249. package/lib/module/ui/session/projectSessionState.js.map +0 -1
  250. package/lib/module/ui/session/sessionClientHost.js +0 -26
  251. package/lib/module/ui/session/sessionClientHost.js.map +0 -1
  252. package/lib/module/ui/utils/activeAuthuser.js +0 -134
  253. package/lib/module/ui/utils/activeAuthuser.js.map +0 -1
  254. package/lib/module/utils/crossApex.js +0 -69
  255. package/lib/module/utils/crossApex.js.map +0 -1
  256. package/lib/typescript/commonjs/ui/context/inSessionTokenRefresh.d.ts +0 -106
  257. package/lib/typescript/commonjs/ui/context/inSessionTokenRefresh.d.ts.map +0 -1
  258. package/lib/typescript/commonjs/ui/context/silentSessionRestore.d.ts +0 -36
  259. package/lib/typescript/commonjs/ui/context/silentSessionRestore.d.ts.map +0 -1
  260. package/lib/typescript/commonjs/ui/hooks/useWebSSO.d.ts +0 -19
  261. package/lib/typescript/commonjs/ui/hooks/useWebSSO.d.ts.map +0 -1
  262. package/lib/typescript/commonjs/ui/session/projectSessionState.d.ts +0 -45
  263. package/lib/typescript/commonjs/ui/session/projectSessionState.d.ts.map +0 -1
  264. package/lib/typescript/commonjs/ui/session/sessionClientHost.d.ts +0 -14
  265. package/lib/typescript/commonjs/ui/session/sessionClientHost.d.ts.map +0 -1
  266. package/lib/typescript/commonjs/ui/utils/activeAuthuser.d.ts +0 -67
  267. package/lib/typescript/commonjs/ui/utils/activeAuthuser.d.ts.map +0 -1
  268. package/lib/typescript/commonjs/utils/crossApex.d.ts +0 -55
  269. package/lib/typescript/commonjs/utils/crossApex.d.ts.map +0 -1
  270. package/lib/typescript/module/ui/context/inSessionTokenRefresh.d.ts +0 -106
  271. package/lib/typescript/module/ui/context/inSessionTokenRefresh.d.ts.map +0 -1
  272. package/lib/typescript/module/ui/context/silentSessionRestore.d.ts +0 -36
  273. package/lib/typescript/module/ui/context/silentSessionRestore.d.ts.map +0 -1
  274. package/lib/typescript/module/ui/hooks/useWebSSO.d.ts +0 -19
  275. package/lib/typescript/module/ui/hooks/useWebSSO.d.ts.map +0 -1
  276. package/lib/typescript/module/ui/session/projectSessionState.d.ts +0 -45
  277. package/lib/typescript/module/ui/session/projectSessionState.d.ts.map +0 -1
  278. package/lib/typescript/module/ui/session/sessionClientHost.d.ts +0 -14
  279. package/lib/typescript/module/ui/session/sessionClientHost.d.ts.map +0 -1
  280. package/lib/typescript/module/ui/utils/activeAuthuser.d.ts +0 -67
  281. package/lib/typescript/module/ui/utils/activeAuthuser.d.ts.map +0 -1
  282. package/lib/typescript/module/utils/crossApex.d.ts +0 -55
  283. package/lib/typescript/module/utils/crossApex.d.ts.map +0 -1
  284. package/src/ui/context/inSessionTokenRefresh.ts +0 -264
  285. package/src/ui/context/silentSessionRestore.ts +0 -53
  286. package/src/ui/hooks/useWebSSO.ts +0 -23
  287. package/src/ui/session/__tests__/projectSessionState.test.ts +0 -114
  288. package/src/ui/session/__tests__/sessionClientHost.test.ts +0 -43
  289. package/src/ui/session/projectSessionState.ts +0 -85
  290. package/src/ui/session/sessionClientHost.ts +0 -27
  291. package/src/ui/utils/activeAuthuser.ts +0 -142
  292. package/src/utils/crossApex.ts +0 -75
@@ -11,27 +11,38 @@ var _reactNativeSafeAreaContext = require("react-native-safe-area-context");
11
11
  var _theme = require("@oxyhq/bloom/theme");
12
12
  var _button = require("@oxyhq/bloom/button");
13
13
  var _loading = require("@oxyhq/bloom/loading");
14
+ var _bloom = require("@oxyhq/bloom");
15
+ var _vectorIcons = require("@expo/vector-icons");
16
+ var _core = require("@oxyhq/core");
14
17
  var _OxyContext = require("../context/OxyContext.js");
15
18
  var _OxyLogo = _interopRequireDefault(require("./OxyLogo.js"));
16
19
  var _AnotherDeviceQR = _interopRequireDefault(require("./AnotherDeviceQR.js"));
20
+ var _SignInAccountChooser = _interopRequireDefault(require("./SignInAccountChooser.js"));
21
+ var _useSwitchableAccounts = require("../hooks/useSwitchableAccounts.js");
22
+ var _useI18n = require("../hooks/useI18n.js");
17
23
  var _useOxyAuthSession = require("../hooks/useOxyAuthSession.js");
18
- var _crossApex = require("../../utils/crossApex.js");
24
+ var _usePasswordSignIn = require("../hooks/usePasswordSignIn.js");
19
25
  var _jsxRuntime = require("react/jsx-runtime");
20
26
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
21
27
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
22
28
  /**
23
- * SignInModal - Web-first centered sign-in modal (Continue with Oxy)
29
+ * SignInModal web-first centered sign-in modal.
24
30
  *
25
- * A semi-transparent full-screen modal whose primary action is the one-tap
26
- * "Continue with Oxy" approval flow. The QR code is demoted to a collapsed
27
- * "Sign in on another device" disclosure (you can't scan your own screen).
31
+ * Two phases, Google-style:
32
+ * 1. Account chooser (FRONT screen, shown when the device/user already has
33
+ * accounts): pick an account to continue as one tap switches through the
34
+ * SAME `switchToAccount` path the account switcher uses — or "Use another
35
+ * account" to reveal the sign-in options.
36
+ * 2. Sign-in options: the first-party password flow (identifier → password →
37
+ * optional 2FA, `usePasswordSignIn`) as the PRIMARY action, with the
38
+ * cross-app device flow (same-device deep-link + "sign in on another device"
39
+ * QR) as a SECONDARY option below an "or" divider.
28
40
  *
29
- * ALL of the auth-session machinery (session-token creation, QR data, socket +
30
- * polling, waiting/error/retry state, the open-auth handler, deep-link return,
31
- * and cleanup) lives in the shared `useOxyAuthSession` hook, which the native
32
- * `OxyAuthScreen` also consumes neither container re-implements the transport.
33
- *
34
- * Animates with a fade + scale effect.
41
+ * When there are no accounts the modal opens straight on the sign-in options.
42
+ * The device-flow machinery lives in the shared `useOxyAuthSession` hook (the
43
+ * native `OxyAuthScreen` consumes it too neither container re-implements the
44
+ * transport). Animates with a fade + scale; per-phase content cross-fades and
45
+ * respects reduced motion.
35
46
  */
36
47
 
37
48
  // Store for modal visibility with subscription support
@@ -63,11 +74,6 @@ const SignInModal = () => {
63
74
  const [visible, setVisible] = (0, _react.useState)(false);
64
75
  const insets = (0, _reactNativeSafeAreaContext.useSafeAreaInsets)();
65
76
  const theme = (0, _theme.useTheme)();
66
- const {
67
- oxyServices,
68
- handleWebSession,
69
- clientId
70
- } = (0, _OxyContext.useOxy)();
71
77
 
72
78
  // Register the imperative visibility callback.
73
79
  (0, _react.useEffect)(() => {
@@ -78,56 +84,71 @@ const SignInModal = () => {
78
84
  }, []);
79
85
  if (!visible) return null;
80
86
 
81
- // The hook owns the whole auth-session lifecycle. Mounting it only while the
82
- // modal is visible matches the previous behavior (session created on open,
83
- // cleaned up on close) — the inner component is unmounted when `visible`
84
- // flips false, which runs the hook's unmount cleanup.
87
+ // Mounting the content only while visible preserves the session-created-on-open
88
+ // / cleaned-up-on-close behaviour and resets the phase state on every reopen.
85
89
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(SignInModalContent, {
86
90
  theme: theme,
87
- insets: insets,
88
- oxyServices: oxyServices,
89
- handleWebSession: handleWebSession,
90
- clientId: clientId
91
+ insets: insets
91
92
  });
92
93
  };
93
94
  const SignInModalContent = ({
94
95
  theme,
95
- insets,
96
- oxyServices,
97
- handleWebSession,
98
- clientId
96
+ insets
99
97
  }) => {
98
+ const {
99
+ oxyServices,
100
+ handleWebSession,
101
+ clientId,
102
+ switchToAccount
103
+ } = (0, _OxyContext.useOxy)();
104
+ const {
105
+ t
106
+ } = (0, _useI18n.useI18n)();
107
+ const {
108
+ accounts
109
+ } = (0, _useSwitchableAccounts.useSwitchableAccounts)();
110
+
111
+ // Phase: the chooser is the front screen whenever accounts exist AND the user
112
+ // has not tapped "Use another account" this session.
113
+ const [useAnother, setUseAnother] = (0, _react.useState)(false);
114
+ const [switchingId, setSwitchingId] = (0, _react.useState)(null);
115
+ const showChooser = !useAnother && accounts.length > 0;
100
116
  const {
101
117
  qrData,
102
118
  qrPayload,
103
119
  isLoading,
104
120
  error,
105
121
  isWaiting,
106
- openAuthApproval,
107
122
  openSameDeviceApproval,
108
123
  retry
109
124
  } = (0, _useOxyAuthSession.useOxyAuthSession)(oxyServices, clientId, handleWebSession, {
110
125
  onSignedIn: hideSignInModal
111
126
  });
112
127
 
113
- // On a cross-apex web RP, only the "Continue with Oxy" IdP popup establishes
114
- // a durable `fedcm_session`. The Commons-app handoffs (same-device deep-link
115
- // + cross-device QR) approve OUTSIDE the browser, so they leave no IdP
116
- // session and the user would be logged out on reload — hide them there.
117
- const crossApexWeb = (0, _crossApex.isCrossApexWeb)();
128
+ // First-party password sign-in the PRIMARY option once past the chooser.
129
+ const pw = (0, _usePasswordSignIn.usePasswordSignIn)({
130
+ onSignedIn: hideSignInModal
131
+ });
118
132
 
119
- // Entrance animation.
133
+ // Entrance animation (respects reduced motion).
120
134
  const opacity = (0, _reactNativeReanimated.useSharedValue)(0);
121
135
  const scale = (0, _reactNativeReanimated.useSharedValue)(0.96);
122
-
123
- // biome-ignore lint/correctness/useExhaustiveDependencies: opacity/scale are Reanimated SharedValues (stable refs) and must not be listed as deps; this runs once on mount to play the entrance.
136
+ // biome-ignore lint/correctness/useExhaustiveDependencies: opacity/scale are Reanimated SharedValues (stable refs), not deps; runs once on mount.
124
137
  (0, _react.useEffect)(() => {
125
- opacity.value = (0, _reactNativeReanimated.withTiming)(1, {
126
- duration: 250
127
- });
128
- scale.value = (0, _reactNativeReanimated.withTiming)(1, {
129
- duration: 250
138
+ let cancelled = false;
139
+ _reactNative.AccessibilityInfo.isReduceMotionEnabled().then(reduced => {
140
+ if (cancelled) return;
141
+ const duration = reduced ? 0 : 250;
142
+ opacity.value = (0, _reactNativeReanimated.withTiming)(1, {
143
+ duration
144
+ });
145
+ scale.value = (0, _reactNativeReanimated.withTiming)(1, {
146
+ duration
147
+ });
130
148
  });
149
+ return () => {
150
+ cancelled = true;
151
+ };
131
152
  }, []);
132
153
  const backdropStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => ({
133
154
  opacity: opacity.value
@@ -138,12 +159,32 @@ const SignInModalContent = ({
138
159
  scale: scale.value
139
160
  }]
140
161
  }));
141
- const handleClose = (0, _react.useCallback)(() => {
142
- hideSignInModal();
143
- }, []);
144
- const handleCreateAccount = (0, _react.useCallback)(() => {
145
- _reactNative.Linking.openURL(_useOxyAuthSession.OXY_ACCOUNTS_WEB_URL);
146
- }, []);
162
+ const handleClose = (0, _react.useCallback)(() => hideSignInModal(), []);
163
+ const handleCreateAccount = (0, _react.useCallback)(() => _reactNative.Linking.openURL(_useOxyAuthSession.OXY_ACCOUNTS_WEB_URL), []);
164
+ const handleSelectAccount = (0, _react.useCallback)(async account => {
165
+ // The active account is already signed in — selecting it just continues.
166
+ if (account.isCurrent) {
167
+ hideSignInModal();
168
+ return;
169
+ }
170
+ if (switchingId) return;
171
+ setSwitchingId(account.accountId);
172
+ try {
173
+ await switchToAccount(account.accountId);
174
+ hideSignInModal();
175
+ } catch (switchError) {
176
+ if ((0, _core.isDev)()) {
177
+ _core.logger.warn('SignInModal: switch account failed', {
178
+ component: 'SignInModal'
179
+ }, switchError);
180
+ }
181
+ _bloom.toast.error(t('accountSwitcher.toasts.switchFailed') || 'Failed to switch account');
182
+ } finally {
183
+ setSwitchingId(null);
184
+ }
185
+ }, [switchingId, switchToAccount, t]);
186
+ const title = showChooser ? t('signin.chooser.title') : 'Sign in to Oxy';
187
+ const subtitle = showChooser ? t('signin.chooser.subtitle') : 'Continue with your Oxy identity to sign in securely.';
147
188
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Modal, {
148
189
  visible: true,
149
190
  transparent: true,
@@ -161,7 +202,7 @@ const SignInModalContent = ({
161
202
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeReanimated.default.View, {
162
203
  style: [styles.card, {
163
204
  backgroundColor: theme.colors.card,
164
- paddingTop: insets.top + 24,
205
+ paddingTop: insets.top + 28,
165
206
  paddingBottom: insets.bottom + 24
166
207
  }, contentStyle],
167
208
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
@@ -171,72 +212,159 @@ const SignInModalContent = ({
171
212
  onPress: handleClose,
172
213
  accessibilityRole: "button",
173
214
  accessibilityLabel: "Close sign in",
174
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
175
- style: [styles.closeButtonText, {
176
- color: theme.colors.textSecondary
177
- }],
178
- children: "\xD7"
215
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
216
+ name: "close",
217
+ size: 22,
218
+ color: theme.colors.textSecondary
179
219
  })
180
220
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
181
221
  style: styles.header,
182
222
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyLogo.default, {
183
223
  variant: "icon",
184
- size: 56
224
+ size: 52
185
225
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
186
226
  className: "text-foreground",
187
227
  style: styles.title,
188
- children: "Sign in to Oxy"
228
+ children: title
189
229
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
190
230
  className: "text-muted-foreground",
191
231
  style: styles.subtitle,
192
- children: "Continue with your Oxy identity to sign in securely"
232
+ children: subtitle
193
233
  })]
194
- }), isLoading ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
195
- style: styles.loadingContainer,
196
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_loading.Loading, {
197
- size: "large"
198
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
199
- className: "text-muted-foreground",
200
- style: styles.loadingText,
201
- children: "Preparing sign in..."
202
- })]
203
- }) : error ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
204
- style: styles.errorContainer,
205
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
206
- className: "text-destructive",
207
- style: styles.errorText,
208
- children: error
209
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_button.Button, {
210
- variant: "primary",
211
- onPress: retry,
212
- style: styles.primaryButton,
213
- children: "Try Again"
214
- })]
215
- }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
216
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_button.Button, {
217
- variant: "primary",
218
- onPress: openAuthApproval,
219
- icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyLogo.default, {
220
- variant: "icon",
221
- size: 20,
222
- fillColor: theme.colors.primaryForeground,
223
- style: styles.buttonIcon
224
- }),
225
- style: styles.primaryButton,
226
- children: "Continue with Oxy"
227
- }), !crossApexWeb && qrPayload && /*#__PURE__*/(0, _jsxRuntime.jsx)(_button.Button, {
228
- variant: "secondary",
229
- onPress: openSameDeviceApproval,
230
- icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyLogo.default, {
231
- variant: "icon",
232
- size: 20,
233
- fillColor: theme.colors.text,
234
- style: styles.buttonIcon
235
- }),
236
- style: styles.secondaryButton,
237
- children: "Sign in with the Oxy app"
238
- }), isWaiting && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
239
- style: styles.statusContainer,
234
+ }), showChooser ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
235
+ entering: _reactNativeReanimated.FadeIn.duration(180),
236
+ style: styles.phase,
237
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SignInAccountChooser.default, {
238
+ accounts: accounts,
239
+ onSelectAccount: handleSelectAccount,
240
+ onUseAnother: () => setUseAnother(true),
241
+ pendingAccountId: switchingId,
242
+ disabled: switchingId !== null
243
+ })
244
+ }, "chooser") : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeReanimated.default.View, {
245
+ entering: _reactNativeReanimated.FadeIn.duration(180),
246
+ style: styles.phase,
247
+ children: [accounts.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
248
+ onPress: () => setUseAnother(false),
249
+ accessibilityRole: "button",
250
+ style: styles.backRow,
251
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
252
+ name: "chevron-back",
253
+ size: 18,
254
+ color: theme.colors.textSecondary
255
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
256
+ style: [styles.backText, {
257
+ color: theme.colors.textSecondary
258
+ }],
259
+ children: t('signin.chooser.title')
260
+ })]
261
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
262
+ style: styles.form,
263
+ children: [pw.step === 'identifier' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
264
+ style: [styles.input, {
265
+ borderColor: theme.colors.border,
266
+ color: theme.colors.text,
267
+ backgroundColor: theme.colors.backgroundSecondary
268
+ }],
269
+ value: pw.identifier,
270
+ onChangeText: pw.setIdentifier,
271
+ onSubmitEditing: pw.submitIdentifier,
272
+ placeholder: "Username or email",
273
+ placeholderTextColor: theme.colors.textSecondary,
274
+ autoCapitalize: "none",
275
+ autoCorrect: false,
276
+ keyboardType: "email-address",
277
+ returnKeyType: "next",
278
+ accessibilityLabel: "Username or email"
279
+ }), pw.step === 'password' && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
280
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
281
+ style: [styles.contextText, {
282
+ color: theme.colors.textSecondary
283
+ }],
284
+ children: pw.identifier
285
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
286
+ style: [styles.input, {
287
+ borderColor: theme.colors.border,
288
+ color: theme.colors.text,
289
+ backgroundColor: theme.colors.backgroundSecondary
290
+ }],
291
+ value: pw.password,
292
+ onChangeText: pw.setPassword,
293
+ onSubmitEditing: pw.submitPassword,
294
+ placeholder: "Password",
295
+ placeholderTextColor: theme.colors.textSecondary,
296
+ secureTextEntry: true,
297
+ autoCapitalize: "none",
298
+ autoCorrect: false,
299
+ returnKeyType: "go",
300
+ accessibilityLabel: "Password"
301
+ })]
302
+ }), pw.step === 'twoFactor' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
303
+ style: [styles.input, {
304
+ borderColor: theme.colors.border,
305
+ color: theme.colors.text,
306
+ backgroundColor: theme.colors.backgroundSecondary
307
+ }],
308
+ value: pw.code,
309
+ onChangeText: pw.setCode,
310
+ onSubmitEditing: pw.submitTwoFactor,
311
+ placeholder: pw.useBackupCode ? 'Backup code' : '6-digit code',
312
+ placeholderTextColor: theme.colors.textSecondary,
313
+ autoCapitalize: "none",
314
+ autoCorrect: false,
315
+ keyboardType: pw.useBackupCode ? 'default' : 'number-pad',
316
+ returnKeyType: "go",
317
+ accessibilityLabel: pw.useBackupCode ? 'Backup code' : 'Two-factor code'
318
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_button.Button, {
319
+ variant: "primary",
320
+ onPress: pw.step === 'identifier' ? pw.submitIdentifier : pw.step === 'password' ? pw.submitPassword : pw.submitTwoFactor,
321
+ loading: pw.isSubmitting,
322
+ disabled: pw.isSubmitting,
323
+ style: styles.primaryButton,
324
+ children: pw.step === 'identifier' ? 'Continue' : pw.step === 'password' ? 'Sign in' : 'Verify'
325
+ }), pw.error && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
326
+ className: "text-destructive",
327
+ style: styles.formError,
328
+ children: pw.error
329
+ }), pw.step === 'twoFactor' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
330
+ onPress: () => pw.setUseBackupCode(!pw.useBackupCode),
331
+ accessibilityRole: "button",
332
+ style: styles.linkButton,
333
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
334
+ style: [styles.linkText, {
335
+ color: theme.colors.primary
336
+ }],
337
+ children: pw.useBackupCode ? 'Use authenticator code' : 'Use a backup code'
338
+ })
339
+ }), pw.step !== 'identifier' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
340
+ onPress: pw.back,
341
+ accessibilityRole: "button",
342
+ style: styles.linkButton,
343
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
344
+ style: [styles.linkText, {
345
+ color: theme.colors.textSecondary
346
+ }],
347
+ children: "Back"
348
+ })
349
+ })]
350
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
351
+ style: styles.dividerRow,
352
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
353
+ style: [styles.dividerLine, {
354
+ backgroundColor: theme.colors.border
355
+ }]
356
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
357
+ style: [styles.dividerText, {
358
+ color: theme.colors.textSecondary
359
+ }],
360
+ children: "or"
361
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
362
+ style: [styles.dividerLine, {
363
+ backgroundColor: theme.colors.border
364
+ }]
365
+ })]
366
+ }), isLoading ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
367
+ style: styles.deviceLoading,
240
368
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_loading.Loading, {
241
369
  size: "small",
242
370
  style: styles.statusSpinner
@@ -244,16 +372,52 @@ const SignInModalContent = ({
244
372
  style: [styles.statusText, {
245
373
  color: theme.colors.textSecondary
246
374
  }],
247
- children: "Waiting for authorization..."
375
+ children: "Preparing sign in\u2026"
376
+ })]
377
+ }) : error ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
378
+ style: styles.errorContainer,
379
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
380
+ className: "text-destructive",
381
+ style: styles.errorText,
382
+ children: error
383
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_button.Button, {
384
+ variant: "secondary",
385
+ onPress: retry,
386
+ style: styles.secondaryButton,
387
+ children: "Try Again"
388
+ })]
389
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
390
+ children: [qrPayload && /*#__PURE__*/(0, _jsxRuntime.jsx)(_button.Button, {
391
+ variant: "secondary",
392
+ onPress: openSameDeviceApproval,
393
+ icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyLogo.default, {
394
+ variant: "icon",
395
+ size: 20,
396
+ fillColor: theme.colors.text,
397
+ style: styles.buttonIcon
398
+ }),
399
+ style: styles.secondaryButton,
400
+ children: "Sign in with the Oxy app"
401
+ }), isWaiting && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
402
+ style: styles.statusContainer,
403
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_loading.Loading, {
404
+ size: "small",
405
+ style: styles.statusSpinner
406
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
407
+ style: [styles.statusText, {
408
+ color: theme.colors.textSecondary
409
+ }],
410
+ children: "Waiting for authorization\u2026"
411
+ })]
412
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
413
+ style: styles.qrSection,
414
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_AnotherDeviceQR.default, {
415
+ qrData: qrData,
416
+ qrPayload: qrPayload
417
+ })
248
418
  })]
249
- }), !crossApexWeb && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
250
- style: styles.qrSection,
251
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_AnotherDeviceQR.default, {
252
- qrData: qrData,
253
- qrPayload: qrPayload
254
- })
255
419
  })]
256
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
420
+ }, "signIn"), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
257
421
  style: styles.footer,
258
422
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
259
423
  style: styles.footerText,
@@ -281,42 +445,54 @@ const styles = _reactNative.StyleSheet.create({
281
445
  },
282
446
  card: {
283
447
  width: '100%',
284
- maxWidth: 400,
448
+ maxWidth: 420,
285
449
  alignItems: 'center',
286
450
  paddingHorizontal: 24,
287
- borderRadius: 24
451
+ borderRadius: 28
288
452
  },
289
453
  closeButton: {
290
454
  position: 'absolute',
291
455
  top: 16,
292
456
  right: 16,
293
- width: 40,
294
- height: 40,
295
- borderRadius: 20,
457
+ width: 36,
458
+ height: 36,
459
+ borderRadius: 18,
296
460
  justifyContent: 'center',
297
461
  alignItems: 'center',
298
462
  zIndex: 10
299
463
  },
300
- closeButtonText: {
301
- fontSize: 28,
302
- fontWeight: '300',
303
- lineHeight: 32
304
- },
305
464
  header: {
306
465
  alignItems: 'center',
307
- marginBottom: 28
466
+ marginBottom: 24
308
467
  },
309
468
  title: {
310
469
  fontSize: 26,
311
- fontWeight: 'bold',
470
+ fontWeight: '800',
471
+ letterSpacing: -0.5,
312
472
  marginTop: 16,
313
473
  textAlign: 'center'
314
474
  },
315
475
  subtitle: {
316
476
  fontSize: 15,
477
+ lineHeight: 21,
317
478
  marginTop: 8,
318
479
  textAlign: 'center'
319
480
  },
481
+ phase: {
482
+ width: '100%'
483
+ },
484
+ backRow: {
485
+ flexDirection: 'row',
486
+ alignItems: 'center',
487
+ gap: 4,
488
+ alignSelf: 'flex-start',
489
+ paddingVertical: 6,
490
+ marginBottom: 8
491
+ },
492
+ backText: {
493
+ fontSize: 14,
494
+ fontWeight: '600'
495
+ },
320
496
  primaryButton: {
321
497
  width: '100%',
322
498
  borderRadius: 12
@@ -329,6 +505,57 @@ const styles = _reactNative.StyleSheet.create({
329
505
  buttonIcon: {
330
506
  marginRight: 10
331
507
  },
508
+ form: {
509
+ width: '100%'
510
+ },
511
+ input: {
512
+ width: '100%',
513
+ borderWidth: 1,
514
+ borderRadius: 12,
515
+ paddingHorizontal: 16,
516
+ paddingVertical: 13,
517
+ fontSize: 15,
518
+ marginBottom: 12
519
+ },
520
+ contextText: {
521
+ fontSize: 14,
522
+ textAlign: 'center',
523
+ marginBottom: 12
524
+ },
525
+ formError: {
526
+ fontSize: 14,
527
+ textAlign: 'center',
528
+ marginTop: 12
529
+ },
530
+ linkButton: {
531
+ alignSelf: 'center',
532
+ paddingVertical: 8,
533
+ marginTop: 8
534
+ },
535
+ linkText: {
536
+ fontSize: 14,
537
+ fontWeight: '600'
538
+ },
539
+ dividerRow: {
540
+ flexDirection: 'row',
541
+ alignItems: 'center',
542
+ width: '100%',
543
+ marginVertical: 20
544
+ },
545
+ dividerLine: {
546
+ flex: 1,
547
+ height: 1
548
+ },
549
+ dividerText: {
550
+ marginHorizontal: 12,
551
+ fontSize: 13
552
+ },
553
+ deviceLoading: {
554
+ flexDirection: 'row',
555
+ alignItems: 'center',
556
+ justifyContent: 'center',
557
+ paddingVertical: 12
558
+ },
332
559
  statusContainer: {
333
560
  flexDirection: 'row',
334
561
  alignItems: 'center',
@@ -345,14 +572,6 @@ const styles = _reactNative.StyleSheet.create({
345
572
  width: '100%',
346
573
  marginTop: 24
347
574
  },
348
- loadingContainer: {
349
- alignItems: 'center',
350
- paddingVertical: 40
351
- },
352
- loadingText: {
353
- marginTop: 16,
354
- fontSize: 14
355
- },
356
575
  errorContainer: {
357
576
  alignItems: 'center',
358
577
  paddingVertical: 20,