@oxyhq/services 14.1.0 → 15.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 (262) hide show
  1. package/lib/commonjs/index.js +0 -17
  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/useAuth.js +14 -33
  12. package/lib/commonjs/ui/hooks/useAuth.js.map +1 -1
  13. package/lib/commonjs/ui/hooks/usePasswordSignIn.js +170 -0
  14. package/lib/commonjs/ui/hooks/usePasswordSignIn.js.map +1 -0
  15. package/lib/commonjs/ui/hooks/useProfileEditing.js +2 -5
  16. package/lib/commonjs/ui/hooks/useProfileEditing.js.map +1 -1
  17. package/lib/commonjs/ui/hooks/useSessionManagement.js +2 -2
  18. package/lib/commonjs/ui/hooks/useSessionManagement.js.map +1 -1
  19. package/lib/commonjs/ui/navigation/routes.js +1 -0
  20. package/lib/commonjs/ui/navigation/routes.js.map +1 -1
  21. package/lib/commonjs/ui/screens/EditProfileFieldScreen.js +93 -68
  22. package/lib/commonjs/ui/screens/EditProfileFieldScreen.js.map +1 -1
  23. package/lib/commonjs/ui/screens/EditProfileScreen.js +187 -0
  24. package/lib/commonjs/ui/screens/EditProfileScreen.js.map +1 -0
  25. package/lib/commonjs/ui/screens/ManageAccountScreen.js +3 -7
  26. package/lib/commonjs/ui/screens/ManageAccountScreen.js.map +1 -1
  27. package/lib/commonjs/ui/screens/OxyAuthScreen.js +231 -95
  28. package/lib/commonjs/ui/screens/OxyAuthScreen.js.map +1 -1
  29. package/lib/commonjs/ui/screens/ProfileScreen.js +15 -2
  30. package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
  31. package/lib/commonjs/ui/screens/linkFormat.js +38 -0
  32. package/lib/commonjs/ui/screens/linkFormat.js.map +1 -0
  33. package/lib/commonjs/ui/session/authStore.js +146 -0
  34. package/lib/commonjs/ui/session/authStore.js.map +1 -0
  35. package/lib/commonjs/ui/session/createSessionClient.js +23 -17
  36. package/lib/commonjs/ui/session/createSessionClient.js.map +1 -1
  37. package/lib/commonjs/ui/session/index.js +13 -7
  38. package/lib/commonjs/ui/session/index.js.map +1 -1
  39. package/lib/commonjs/ui/session/tokenTransport.js +19 -31
  40. package/lib/commonjs/ui/session/tokenTransport.js.map +1 -1
  41. package/lib/commonjs/ui/utils/isWebBrowser.js +13 -0
  42. package/lib/commonjs/ui/utils/isWebBrowser.js.map +1 -0
  43. package/lib/commonjs/utils/deviceFlowSignIn.js +13 -16
  44. package/lib/commonjs/utils/deviceFlowSignIn.js.map +1 -1
  45. package/lib/module/index.js +0 -5
  46. package/lib/module/index.js.map +1 -1
  47. package/lib/module/ui/components/SignInAccountChooser.js +183 -0
  48. package/lib/module/ui/components/SignInAccountChooser.js.map +1 -0
  49. package/lib/module/ui/components/SignInModal.js +352 -134
  50. package/lib/module/ui/components/SignInModal.js.map +1 -1
  51. package/lib/module/ui/context/OxyContext.js +342 -1551
  52. package/lib/module/ui/context/OxyContext.js.map +1 -1
  53. package/lib/module/ui/context/hooks/useAuthOperations.js +60 -63
  54. package/lib/module/ui/context/hooks/useAuthOperations.js.map +1 -1
  55. package/lib/module/ui/hooks/useAuth.js +14 -33
  56. package/lib/module/ui/hooks/useAuth.js.map +1 -1
  57. package/lib/module/ui/hooks/usePasswordSignIn.js +165 -0
  58. package/lib/module/ui/hooks/usePasswordSignIn.js.map +1 -0
  59. package/lib/module/ui/hooks/useProfileEditing.js +2 -5
  60. package/lib/module/ui/hooks/useProfileEditing.js.map +1 -1
  61. package/lib/module/ui/hooks/useSessionManagement.js +1 -1
  62. package/lib/module/ui/hooks/useSessionManagement.js.map +1 -1
  63. package/lib/module/ui/navigation/routes.js +1 -0
  64. package/lib/module/ui/navigation/routes.js.map +1 -1
  65. package/lib/module/ui/screens/EditProfileFieldScreen.js +91 -66
  66. package/lib/module/ui/screens/EditProfileFieldScreen.js.map +1 -1
  67. package/lib/module/ui/screens/EditProfileScreen.js +182 -0
  68. package/lib/module/ui/screens/EditProfileScreen.js.map +1 -0
  69. package/lib/module/ui/screens/ManageAccountScreen.js +3 -7
  70. package/lib/module/ui/screens/ManageAccountScreen.js.map +1 -1
  71. package/lib/module/ui/screens/OxyAuthScreen.js +233 -97
  72. package/lib/module/ui/screens/OxyAuthScreen.js.map +1 -1
  73. package/lib/module/ui/screens/ProfileScreen.js +15 -2
  74. package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
  75. package/lib/module/ui/screens/linkFormat.js +31 -0
  76. package/lib/module/ui/screens/linkFormat.js.map +1 -0
  77. package/lib/module/ui/session/authStore.js +143 -0
  78. package/lib/module/ui/session/authStore.js.map +1 -0
  79. package/lib/module/ui/session/createSessionClient.js +22 -16
  80. package/lib/module/ui/session/createSessionClient.js.map +1 -1
  81. package/lib/module/ui/session/index.js +9 -9
  82. package/lib/module/ui/session/index.js.map +1 -1
  83. package/lib/module/ui/session/tokenTransport.js +20 -33
  84. package/lib/module/ui/session/tokenTransport.js.map +1 -1
  85. package/lib/module/ui/utils/isWebBrowser.js +11 -0
  86. package/lib/module/ui/utils/isWebBrowser.js.map +1 -0
  87. package/lib/module/utils/deviceFlowSignIn.js +14 -17
  88. package/lib/module/utils/deviceFlowSignIn.js.map +1 -1
  89. package/lib/typescript/commonjs/index.d.ts +0 -1
  90. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  91. package/lib/typescript/commonjs/ui/components/SignInAccountChooser.d.ts +29 -0
  92. package/lib/typescript/commonjs/ui/components/SignInAccountChooser.d.ts.map +1 -0
  93. package/lib/typescript/commonjs/ui/components/SignInModal.d.ts +15 -10
  94. package/lib/typescript/commonjs/ui/components/SignInModal.d.ts.map +1 -1
  95. package/lib/typescript/commonjs/ui/context/OxyContext.d.ts +36 -42
  96. package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
  97. package/lib/typescript/commonjs/ui/context/hooks/useAuthOperations.d.ts +18 -23
  98. package/lib/typescript/commonjs/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
  99. package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts +0 -2
  100. package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
  101. package/lib/typescript/commonjs/ui/hooks/useAuth.d.ts.map +1 -1
  102. package/lib/typescript/commonjs/ui/hooks/usePasswordSignIn.d.ts +31 -0
  103. package/lib/typescript/commonjs/ui/hooks/usePasswordSignIn.d.ts.map +1 -0
  104. package/lib/typescript/commonjs/ui/hooks/useProfileEditing.d.ts +0 -1
  105. package/lib/typescript/commonjs/ui/hooks/useProfileEditing.d.ts.map +1 -1
  106. package/lib/typescript/commonjs/ui/navigation/routes.d.ts +1 -1
  107. package/lib/typescript/commonjs/ui/navigation/routes.d.ts.map +1 -1
  108. package/lib/typescript/commonjs/ui/screens/EditProfileFieldScreen.d.ts.map +1 -1
  109. package/lib/typescript/commonjs/ui/screens/EditProfileScreen.d.ts +14 -0
  110. package/lib/typescript/commonjs/ui/screens/EditProfileScreen.d.ts.map +1 -0
  111. package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts +1 -1
  112. package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts.map +1 -1
  113. package/lib/typescript/commonjs/ui/screens/OxyAuthScreen.d.ts +13 -12
  114. package/lib/typescript/commonjs/ui/screens/OxyAuthScreen.d.ts.map +1 -1
  115. package/lib/typescript/commonjs/ui/screens/ProfileScreen.d.ts.map +1 -1
  116. package/lib/typescript/commonjs/ui/screens/linkFormat.d.ts +23 -0
  117. package/lib/typescript/commonjs/ui/screens/linkFormat.d.ts.map +1 -0
  118. package/lib/typescript/commonjs/ui/session/authStore.d.ts +33 -0
  119. package/lib/typescript/commonjs/ui/session/authStore.d.ts.map +1 -0
  120. package/lib/typescript/commonjs/ui/session/createSessionClient.d.ts +19 -15
  121. package/lib/typescript/commonjs/ui/session/createSessionClient.d.ts.map +1 -1
  122. package/lib/typescript/commonjs/ui/session/index.d.ts +9 -9
  123. package/lib/typescript/commonjs/ui/session/index.d.ts.map +1 -1
  124. package/lib/typescript/commonjs/ui/session/tokenTransport.d.ts +13 -19
  125. package/lib/typescript/commonjs/ui/session/tokenTransport.d.ts.map +1 -1
  126. package/lib/typescript/commonjs/ui/utils/isWebBrowser.d.ts +9 -0
  127. package/lib/typescript/commonjs/ui/utils/isWebBrowser.d.ts.map +1 -0
  128. package/lib/typescript/commonjs/utils/deviceFlowSignIn.d.ts +15 -13
  129. package/lib/typescript/commonjs/utils/deviceFlowSignIn.d.ts.map +1 -1
  130. package/lib/typescript/module/index.d.ts +0 -1
  131. package/lib/typescript/module/index.d.ts.map +1 -1
  132. package/lib/typescript/module/ui/components/SignInAccountChooser.d.ts +29 -0
  133. package/lib/typescript/module/ui/components/SignInAccountChooser.d.ts.map +1 -0
  134. package/lib/typescript/module/ui/components/SignInModal.d.ts +15 -10
  135. package/lib/typescript/module/ui/components/SignInModal.d.ts.map +1 -1
  136. package/lib/typescript/module/ui/context/OxyContext.d.ts +36 -42
  137. package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
  138. package/lib/typescript/module/ui/context/hooks/useAuthOperations.d.ts +18 -23
  139. package/lib/typescript/module/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
  140. package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts +0 -2
  141. package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
  142. package/lib/typescript/module/ui/hooks/useAuth.d.ts.map +1 -1
  143. package/lib/typescript/module/ui/hooks/usePasswordSignIn.d.ts +31 -0
  144. package/lib/typescript/module/ui/hooks/usePasswordSignIn.d.ts.map +1 -0
  145. package/lib/typescript/module/ui/hooks/useProfileEditing.d.ts +0 -1
  146. package/lib/typescript/module/ui/hooks/useProfileEditing.d.ts.map +1 -1
  147. package/lib/typescript/module/ui/navigation/routes.d.ts +1 -1
  148. package/lib/typescript/module/ui/navigation/routes.d.ts.map +1 -1
  149. package/lib/typescript/module/ui/screens/EditProfileFieldScreen.d.ts.map +1 -1
  150. package/lib/typescript/module/ui/screens/EditProfileScreen.d.ts +14 -0
  151. package/lib/typescript/module/ui/screens/EditProfileScreen.d.ts.map +1 -0
  152. package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts +1 -1
  153. package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts.map +1 -1
  154. package/lib/typescript/module/ui/screens/OxyAuthScreen.d.ts +13 -12
  155. package/lib/typescript/module/ui/screens/OxyAuthScreen.d.ts.map +1 -1
  156. package/lib/typescript/module/ui/screens/ProfileScreen.d.ts.map +1 -1
  157. package/lib/typescript/module/ui/screens/linkFormat.d.ts +23 -0
  158. package/lib/typescript/module/ui/screens/linkFormat.d.ts.map +1 -0
  159. package/lib/typescript/module/ui/session/authStore.d.ts +33 -0
  160. package/lib/typescript/module/ui/session/authStore.d.ts.map +1 -0
  161. package/lib/typescript/module/ui/session/createSessionClient.d.ts +19 -15
  162. package/lib/typescript/module/ui/session/createSessionClient.d.ts.map +1 -1
  163. package/lib/typescript/module/ui/session/index.d.ts +9 -9
  164. package/lib/typescript/module/ui/session/index.d.ts.map +1 -1
  165. package/lib/typescript/module/ui/session/tokenTransport.d.ts +13 -19
  166. package/lib/typescript/module/ui/session/tokenTransport.d.ts.map +1 -1
  167. package/lib/typescript/module/ui/utils/isWebBrowser.d.ts +9 -0
  168. package/lib/typescript/module/ui/utils/isWebBrowser.d.ts.map +1 -0
  169. package/lib/typescript/module/utils/deviceFlowSignIn.d.ts +15 -13
  170. package/lib/typescript/module/utils/deviceFlowSignIn.d.ts.map +1 -1
  171. package/package.json +4 -4
  172. package/src/index.ts +0 -4
  173. package/src/ui/components/SignInAccountChooser.tsx +162 -0
  174. package/src/ui/components/SignInModal.tsx +309 -139
  175. package/src/ui/context/OxyContext.tsx +532 -1785
  176. package/src/ui/context/hooks/useAuthOperations.ts +65 -76
  177. package/src/ui/hooks/useAuth.ts +14 -35
  178. package/src/ui/hooks/usePasswordSignIn.ts +207 -0
  179. package/src/ui/hooks/useProfileEditing.ts +2 -8
  180. package/src/ui/hooks/useSessionManagement.ts +1 -1
  181. package/src/ui/navigation/routes.ts +2 -0
  182. package/src/ui/screens/EditProfileFieldScreen.tsx +102 -66
  183. package/src/ui/screens/EditProfileScreen.tsx +155 -0
  184. package/src/ui/screens/ManageAccountScreen.tsx +3 -7
  185. package/src/ui/screens/OxyAuthScreen.tsx +259 -112
  186. package/src/ui/screens/ProfileScreen.tsx +15 -2
  187. package/src/ui/screens/__tests__/linkFormat.test.ts +73 -0
  188. package/src/ui/screens/linkFormat.ts +37 -0
  189. package/src/ui/session/__tests__/createSessionClient.test.ts +22 -7
  190. package/src/ui/session/__tests__/tokenTransport.test.ts +37 -49
  191. package/src/ui/session/authStore.ts +164 -0
  192. package/src/ui/session/createSessionClient.ts +30 -17
  193. package/src/ui/session/index.ts +10 -9
  194. package/src/ui/session/tokenTransport.ts +26 -36
  195. package/src/ui/utils/isWebBrowser.ts +8 -0
  196. package/src/utils/__tests__/deviceFlowSignIn.test.ts +50 -131
  197. package/src/utils/deviceFlowSignIn.ts +19 -26
  198. package/lib/commonjs/ui/context/inSessionTokenRefresh.js +0 -243
  199. package/lib/commonjs/ui/context/inSessionTokenRefresh.js.map +0 -1
  200. package/lib/commonjs/ui/context/silentSessionRestore.js +0 -56
  201. package/lib/commonjs/ui/context/silentSessionRestore.js.map +0 -1
  202. package/lib/commonjs/ui/hooks/useWebSSO.js +0 -28
  203. package/lib/commonjs/ui/hooks/useWebSSO.js.map +0 -1
  204. package/lib/commonjs/ui/session/projectSessionState.js +0 -86
  205. package/lib/commonjs/ui/session/projectSessionState.js.map +0 -1
  206. package/lib/commonjs/ui/session/sessionClientHost.js +0 -30
  207. package/lib/commonjs/ui/session/sessionClientHost.js.map +0 -1
  208. package/lib/commonjs/ui/utils/activeAuthuser.js +0 -142
  209. package/lib/commonjs/ui/utils/activeAuthuser.js.map +0 -1
  210. package/lib/commonjs/utils/crossApex.js +0 -74
  211. package/lib/commonjs/utils/crossApex.js.map +0 -1
  212. package/lib/module/ui/context/inSessionTokenRefresh.js +0 -238
  213. package/lib/module/ui/context/inSessionTokenRefresh.js.map +0 -1
  214. package/lib/module/ui/context/silentSessionRestore.js +0 -53
  215. package/lib/module/ui/context/silentSessionRestore.js.map +0 -1
  216. package/lib/module/ui/hooks/useWebSSO.js +0 -24
  217. package/lib/module/ui/hooks/useWebSSO.js.map +0 -1
  218. package/lib/module/ui/session/projectSessionState.js +0 -79
  219. package/lib/module/ui/session/projectSessionState.js.map +0 -1
  220. package/lib/module/ui/session/sessionClientHost.js +0 -26
  221. package/lib/module/ui/session/sessionClientHost.js.map +0 -1
  222. package/lib/module/ui/utils/activeAuthuser.js +0 -134
  223. package/lib/module/ui/utils/activeAuthuser.js.map +0 -1
  224. package/lib/module/utils/crossApex.js +0 -69
  225. package/lib/module/utils/crossApex.js.map +0 -1
  226. package/lib/typescript/commonjs/ui/context/inSessionTokenRefresh.d.ts +0 -106
  227. package/lib/typescript/commonjs/ui/context/inSessionTokenRefresh.d.ts.map +0 -1
  228. package/lib/typescript/commonjs/ui/context/silentSessionRestore.d.ts +0 -36
  229. package/lib/typescript/commonjs/ui/context/silentSessionRestore.d.ts.map +0 -1
  230. package/lib/typescript/commonjs/ui/hooks/useWebSSO.d.ts +0 -19
  231. package/lib/typescript/commonjs/ui/hooks/useWebSSO.d.ts.map +0 -1
  232. package/lib/typescript/commonjs/ui/session/projectSessionState.d.ts +0 -45
  233. package/lib/typescript/commonjs/ui/session/projectSessionState.d.ts.map +0 -1
  234. package/lib/typescript/commonjs/ui/session/sessionClientHost.d.ts +0 -14
  235. package/lib/typescript/commonjs/ui/session/sessionClientHost.d.ts.map +0 -1
  236. package/lib/typescript/commonjs/ui/utils/activeAuthuser.d.ts +0 -67
  237. package/lib/typescript/commonjs/ui/utils/activeAuthuser.d.ts.map +0 -1
  238. package/lib/typescript/commonjs/utils/crossApex.d.ts +0 -55
  239. package/lib/typescript/commonjs/utils/crossApex.d.ts.map +0 -1
  240. package/lib/typescript/module/ui/context/inSessionTokenRefresh.d.ts +0 -106
  241. package/lib/typescript/module/ui/context/inSessionTokenRefresh.d.ts.map +0 -1
  242. package/lib/typescript/module/ui/context/silentSessionRestore.d.ts +0 -36
  243. package/lib/typescript/module/ui/context/silentSessionRestore.d.ts.map +0 -1
  244. package/lib/typescript/module/ui/hooks/useWebSSO.d.ts +0 -19
  245. package/lib/typescript/module/ui/hooks/useWebSSO.d.ts.map +0 -1
  246. package/lib/typescript/module/ui/session/projectSessionState.d.ts +0 -45
  247. package/lib/typescript/module/ui/session/projectSessionState.d.ts.map +0 -1
  248. package/lib/typescript/module/ui/session/sessionClientHost.d.ts +0 -14
  249. package/lib/typescript/module/ui/session/sessionClientHost.d.ts.map +0 -1
  250. package/lib/typescript/module/ui/utils/activeAuthuser.d.ts +0 -67
  251. package/lib/typescript/module/ui/utils/activeAuthuser.d.ts.map +0 -1
  252. package/lib/typescript/module/utils/crossApex.d.ts +0 -55
  253. package/lib/typescript/module/utils/crossApex.d.ts.map +0 -1
  254. package/src/ui/context/inSessionTokenRefresh.ts +0 -264
  255. package/src/ui/context/silentSessionRestore.ts +0 -53
  256. package/src/ui/hooks/useWebSSO.ts +0 -23
  257. package/src/ui/session/__tests__/projectSessionState.test.ts +0 -114
  258. package/src/ui/session/__tests__/sessionClientHost.test.ts +0 -43
  259. package/src/ui/session/projectSessionState.ts +0 -85
  260. package/src/ui/session/sessionClientHost.ts +0 -27
  261. package/src/ui/utils/activeAuthuser.ts +0 -142
  262. package/src/utils/crossApex.ts +0 -75
@@ -0,0 +1,146 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createPlatformAuthStateStore = createPlatformAuthStateStore;
7
+ var _core = require("@oxyhq/core");
8
+ var _storageHelpers = require("../utils/storageHelpers.js");
9
+ 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); } /**
10
+ * Platform `AuthStateStore` for `@oxyhq/services`.
11
+ *
12
+ * The device-first session model persists the rotating refresh-token family
13
+ * head per origin (web) / per device (native). `@oxyhq/core` owns the store
14
+ * shape + logic (`createWebAuthStateStore` / `createNativeAuthStateStore`); this
15
+ * module only supplies the platform storage seam and wires the native device
16
+ * token to the SHARED keychain so every native Oxy app joins one DeviceSession:
17
+ *
18
+ * - web → `createWebAuthStateStore()` (localStorage, in-memory fallback).
19
+ * - native → `createNativeAuthStateStore(secureKV)` for the SESSION blob
20
+ * (refresh token) over `expo-secure-store` (AsyncStorage fallback), with the
21
+ * long-lived DEVICE token delegated to `KeyManager`'s shared keychain
22
+ * (`group.so.oxy.shared`) instead of per-app storage — so an in-app login on
23
+ * any native Oxy app attributes to the SAME server-side DeviceSession.
24
+ *
25
+ * `expo-secure-store` is loaded via a runtime-computed dynamic import (the same
26
+ * optional-native-module pattern `OxyProvider` uses for netinfo / keyboard
27
+ * controller), so the web bundle never pulls it and a device without it falls
28
+ * back to AsyncStorage rather than crashing.
29
+ */
30
+ // Variable indirection so Metro's static analyzer never traces expo-secure-store
31
+ // into the web bundle; the module is native-only and optional.
32
+ const SECURE_STORE_MODULE = 'expo-secure-store';
33
+ let secureStorePromise = null;
34
+
35
+ /**
36
+ * Resolve the `expo-secure-store` module once (memoised), or `null` when it is
37
+ * unavailable — callers then fall back to AsyncStorage. Never throws.
38
+ */
39
+ function loadSecureStore() {
40
+ if (!secureStorePromise) {
41
+ const moduleName = SECURE_STORE_MODULE;
42
+ secureStorePromise = (specifier => new Promise(r => r(`${specifier}`)).then(s => _interopRequireWildcard(require(s))))(moduleName).then(mod => {
43
+ if (typeof mod.getItemAsync === 'function' && typeof mod.setItemAsync === 'function' && typeof mod.deleteItemAsync === 'function') {
44
+ return {
45
+ getItemAsync: mod.getItemAsync.bind(mod),
46
+ setItemAsync: mod.setItemAsync.bind(mod),
47
+ deleteItemAsync: mod.deleteItemAsync.bind(mod)
48
+ };
49
+ }
50
+ return null;
51
+ }).catch(() => null);
52
+ }
53
+ return secureStorePromise;
54
+ }
55
+
56
+ /**
57
+ * A native `NativeKeyValueStorage` that prefers `expo-secure-store` (encrypted
58
+ * at rest) and falls back to AsyncStorage when SecureStore is not installed.
59
+ * The SecureStore module is resolved lazily on first access so construction
60
+ * stays synchronous.
61
+ */
62
+ function createNativeSecureKeyValueStorage() {
63
+ let asyncStorage = null;
64
+ const getAsyncStorage = async () => {
65
+ if (!asyncStorage) {
66
+ asyncStorage = await (0, _storageHelpers.createPlatformStorage)();
67
+ }
68
+ return asyncStorage;
69
+ };
70
+ return {
71
+ getItem: async key => {
72
+ const secure = await loadSecureStore();
73
+ if (secure) {
74
+ return secure.getItemAsync(key);
75
+ }
76
+ return (await getAsyncStorage()).getItem(key);
77
+ },
78
+ setItem: async (key, value) => {
79
+ const secure = await loadSecureStore();
80
+ if (secure) {
81
+ await secure.setItemAsync(key, value);
82
+ return;
83
+ }
84
+ await (await getAsyncStorage()).setItem(key, value);
85
+ },
86
+ removeItem: async key => {
87
+ const secure = await loadSecureStore();
88
+ if (secure) {
89
+ await secure.deleteItemAsync(key);
90
+ return;
91
+ }
92
+ await (await getAsyncStorage()).removeItem(key);
93
+ }
94
+ };
95
+ }
96
+
97
+ /**
98
+ * Build the platform {@link AuthStateStore} for this runtime.
99
+ *
100
+ * Native additionally routes the device token through the shared keychain so
101
+ * every native Oxy app shares one server-side DeviceSession; the session blob
102
+ * (refresh token) stays per-app in SecureStore. Best-effort keychain access —
103
+ * a locked/failed shared-keychain read degrades to "no device token" rather
104
+ * than throwing out of cold boot / refresh.
105
+ */
106
+ function createPlatformAuthStateStore() {
107
+ if (!(0, _storageHelpers.isReactNative)()) {
108
+ return (0, _core.createWebAuthStateStore)();
109
+ }
110
+ const base = (0, _core.createNativeAuthStateStore)(createNativeSecureKeyValueStorage());
111
+ return {
112
+ ...base,
113
+ loadDeviceToken: async () => {
114
+ try {
115
+ return await _core.KeyManager.getSharedDeviceToken();
116
+ } catch (error) {
117
+ _core.logger.debug('Shared device-token read failed (treating as none)', {
118
+ component: 'authStore',
119
+ method: 'loadDeviceToken'
120
+ }, error);
121
+ return null;
122
+ }
123
+ },
124
+ saveDeviceToken: async token => {
125
+ try {
126
+ await _core.KeyManager.setSharedDeviceToken(token);
127
+ } catch (error) {
128
+ _core.logger.debug('Shared device-token write failed (non-fatal)', {
129
+ component: 'authStore',
130
+ method: 'saveDeviceToken'
131
+ }, error);
132
+ }
133
+ },
134
+ clearDeviceToken: async () => {
135
+ try {
136
+ await _core.KeyManager.clearSharedDeviceToken();
137
+ } catch (error) {
138
+ _core.logger.debug('Shared device-token clear failed (non-fatal)', {
139
+ component: 'authStore',
140
+ method: 'clearDeviceToken'
141
+ }, error);
142
+ }
143
+ }
144
+ };
145
+ }
146
+ //# sourceMappingURL=authStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_core","require","_storageHelpers","_interopRequireWildcard","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","SECURE_STORE_MODULE","secureStorePromise","loadSecureStore","moduleName","specifier","Promise","then","s","mod","getItemAsync","setItemAsync","deleteItemAsync","bind","catch","createNativeSecureKeyValueStorage","asyncStorage","getAsyncStorage","createPlatformStorage","getItem","key","secure","setItem","value","removeItem","createPlatformAuthStateStore","isReactNative","createWebAuthStateStore","base","createNativeAuthStateStore","loadDeviceToken","KeyManager","getSharedDeviceToken","error","logger","debug","component","method","saveDeviceToken","token","setSharedDeviceToken","clearDeviceToken","clearSharedDeviceToken"],"sourceRoot":"../../../../src","sources":["ui/session/authStore.ts"],"mappings":";;;;;;AAqBA,IAAAA,KAAA,GAAAC,OAAA;AAQA,IAAAC,eAAA,GAAAD,OAAA;AAA+E,SAAAE,wBAAAC,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAH,uBAAA,YAAAA,CAAAC,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,G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MC,IAAI,GAAG,IAAAC,gCAA0B,EAACd,iCAAiC,CAAC,CAAC,CAAC;EAC5E,OAAO;IACL,GAAGa,IAAI;IACPE,eAAe,EAAE,MAAAA,CAAA,KAAY;MAC3B,IAAI;QACF,OAAO,MAAMC,gBAAU,CAACC,oBAAoB,CAAC,CAAC;MAChD,CAAC,CAAC,OAAOC,KAAK,EAAE;QACdC,YAAM,CAACC,KAAK,CACV,oDAAoD,EACpD;UAAEC,SAAS,EAAE,WAAW;UAAEC,MAAM,EAAE;QAAkB,CAAC,EACrDJ,KACF,CAAC;QACD,OAAO,IAAI;MACb;IACF,CAAC;IACDK,eAAe,EAAE,MAAOC,KAAK,IAAK;MAChC,IAAI;QACF,MAAMR,gBAAU,CAACS,oBAAoB,CAACD,KAAK,CAAC;MAC9C,CAAC,CAAC,OAAON,KAAK,EAAE;QACdC,YAAM,CAACC,KAAK,CACV,8CAA8C,EAC9C;UAAEC,SAAS,EAAE,WAAW;UAAEC,MAAM,EAAE;QAAkB,CAAC,EACrDJ,KACF,CAAC;MACH;IACF,CAAC;IACDQ,gBAAgB,EAAE,MAAAA,CAAA,KAAY;MAC5B,IAAI;QACF,MAAMV,gBAAU,CAACW,sBAAsB,CAAC,CAAC;MAC3C,CAAC,CAAC,OAAOT,KAAK,EAAE;QACdC,YAAM,CAACC,KAAK,CACV,8CAA8C,EAC9C;UAAEC,SAAS,EAAE,WAAW;UAAEC,MAAM,EAAE;QAAmB,CAAC,EACtDJ,KACF,CAAC;MACH;IACF;EACF,CAAC;AACH","ignoreList":[]}
@@ -4,30 +4,36 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.createSessionClient = createSessionClient;
7
- var _core = require("@oxyhq/core");
8
7
  var _socket = require("socket.io-client");
9
- var _sessionClientHost = require("./sessionClientHost.js");
8
+ var _core = require("@oxyhq/core");
10
9
  var _tokenTransport = require("./tokenTransport.js");
11
10
  /**
12
- * Wires a `SessionClient` for `@oxyhq/services`: builds the `SessionClientHost`
13
- * adapter (Task 1) and the platform `TokenTransport` (Task 3) over the given
14
- * `OxyServices` instance, and returns both the client and the host — the host
15
- * is returned (not just the client) so `OxyContext` (Fase 3-B) can call
16
- * `host.setCurrentAccountId(...)` as the active account changes.
11
+ * Wire a `SessionClient` for `@oxyhq/services`.
12
+ *
13
+ * The platform-agnostic parts (host adapter, client, projection helpers) live
14
+ * ONCE in `@oxyhq/core`; this thin factory only injects the pieces specific to
15
+ * the RN/Expo SDK:
16
+ *
17
+ * - `socket.io-client`'s `io`, STATICALLY imported (socket.io-client is a real
18
+ * dependency of `@oxyhq/services`) so realtime session sync never relies on
19
+ * core's lazy dynamic import of a bare specifier — bundler-fragile in
20
+ * Metro/Expo-web against the published core dist.
21
+ * - the device-first {@link createTokenTransport}, which mints a fallback token
22
+ * by rotating the persisted refresh family (`store`).
17
23
  *
18
- * `socket.io-client`'s `io` is STATICALLY imported and injected as the
19
- * `SessionClient` `socketFactory` (socket.io-client is a real dependency of
20
- * `@oxyhq/services`). This is what keeps realtime session sync working in the
21
- * Metro/Expo-web bundle: core's lazy dynamic `import('socket.io-client')` of a
22
- * bare specifier does not resolve reliably against the published core dist, so
23
- * the app-bundled static import is the reliable source of the factory.
24
+ * `onUnauthenticated` fires when an applied device state has zero accounts (a
25
+ * device signout-all): the provider clears the persisted store + local state so
26
+ * a reload does not try to restore a dead session. The host is returned
27
+ * alongside the client so the caller can call `host.setCurrentAccountId(...)`
28
+ * as the active account changes.
24
29
  */
25
- function createSessionClient(oxyServices) {
26
- const host = (0, _sessionClientHost.createSessionClientHost)(oxyServices);
27
- const transport = (0, _tokenTransport.createTokenTransport)(oxyServices);
30
+ function createSessionClient(oxyServices, store, onUnauthenticated) {
31
+ const host = (0, _core.createSessionClientHost)(oxyServices);
32
+ const transport = (0, _tokenTransport.createTokenTransport)(oxyServices, store);
28
33
  const client = new _core.SessionClient(host, {
29
34
  transport,
30
- socketFactory: _socket.io
35
+ socketFactory: _socket.io,
36
+ onUnauthenticated
31
37
  });
32
38
  return {
33
39
  client,
@@ -1 +1 @@
1
- {"version":3,"names":["_core","require","_socket","_sessionClientHost","_tokenTransport","createSessionClient","oxyServices","host","createSessionClientHost","transport","createTokenTransport","client","SessionClient","socketFactory","io"],"sourceRoot":"../../../../src","sources":["ui/session/createSessionClient.ts"],"mappings":";;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,kBAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASI,mBAAmBA,CAACC,WAAwB,EAG1D;EACA,MAAMC,IAAI,GAAG,IAAAC,0CAAuB,EAACF,WAAW,CAAC;EACjD,MAAMG,SAAS,GAAG,IAAAC,oCAAoB,EAACJ,WAAW,CAAC;EACnD,MAAMK,MAAM,GAAG,IAAIC,mBAAa,CAACL,IAAI,EAAE;IAAEE,SAAS;IAAEI,aAAa,EAAEC;EAAG,CAAC,CAAC;EACxE,OAAO;IAAEH,MAAM;IAAEJ;EAAK,CAAC;AACzB","ignoreList":[]}
1
+ {"version":3,"names":["_socket","require","_core","_tokenTransport","createSessionClient","oxyServices","store","onUnauthenticated","host","createSessionClientHost","transport","createTokenTransport","client","SessionClient","socketFactory","io"],"sourceRoot":"../../../../src","sources":["ui/session/createSessionClient.ts"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAMA,IAAAE,eAAA,GAAAF,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,mBAAmBA,CACjCC,WAAwB,EACxBC,KAAqB,EACrBC,iBAA8B,EAI9B;EACA,MAAMC,IAAI,GAAG,IAAAC,6BAAuB,EAACJ,WAAW,CAAC;EACjD,MAAMK,SAAS,GAAG,IAAAC,oCAAoB,EAACN,WAAW,EAAEC,KAAK,CAAC;EAC1D,MAAMM,MAAM,GAAG,IAAIC,mBAAa,CAACL,IAAI,EAAE;IAAEE,SAAS;IAAEI,aAAa,EAAEC,UAAE;IAAER;EAAkB,CAAC,CAAC;EAC3F,OAAO;IAAEK,MAAM;IAAEJ;EAAK,CAAC;AACzB","ignoreList":[]}
@@ -6,19 +6,25 @@ Object.defineProperty(exports, "__esModule", {
6
6
  Object.defineProperty(exports, "accountIdsOf", {
7
7
  enumerable: true,
8
8
  get: function () {
9
- return _projectSessionState.accountIdsOf;
9
+ return _core.accountIdsOf;
10
10
  }
11
11
  });
12
12
  Object.defineProperty(exports, "activeSessionIdOf", {
13
13
  enumerable: true,
14
14
  get: function () {
15
- return _projectSessionState.activeSessionIdOf;
15
+ return _core.activeSessionIdOf;
16
16
  }
17
17
  });
18
18
  Object.defineProperty(exports, "activeUserOf", {
19
19
  enumerable: true,
20
20
  get: function () {
21
- return _projectSessionState.activeUserOf;
21
+ return _core.activeUserOf;
22
+ }
23
+ });
24
+ Object.defineProperty(exports, "createPlatformAuthStateStore", {
25
+ enumerable: true,
26
+ get: function () {
27
+ return _authStore.createPlatformAuthStateStore;
22
28
  }
23
29
  });
24
30
  Object.defineProperty(exports, "createSessionClient", {
@@ -30,7 +36,7 @@ Object.defineProperty(exports, "createSessionClient", {
30
36
  Object.defineProperty(exports, "createSessionClientHost", {
31
37
  enumerable: true,
32
38
  get: function () {
33
- return _sessionClientHost.createSessionClientHost;
39
+ return _core.createSessionClientHost;
34
40
  }
35
41
  });
36
42
  Object.defineProperty(exports, "createTokenTransport", {
@@ -42,11 +48,11 @@ Object.defineProperty(exports, "createTokenTransport", {
42
48
  Object.defineProperty(exports, "deviceStateToClientSessions", {
43
49
  enumerable: true,
44
50
  get: function () {
45
- return _projectSessionState.deviceStateToClientSessions;
51
+ return _core.deviceStateToClientSessions;
46
52
  }
47
53
  });
48
54
  var _createSessionClient = require("./createSessionClient.js");
49
- var _sessionClientHost = require("./sessionClientHost.js");
50
55
  var _tokenTransport = require("./tokenTransport.js");
51
- var _projectSessionState = require("./projectSessionState.js");
56
+ var _authStore = require("./authStore.js");
57
+ var _core = require("@oxyhq/core");
52
58
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_createSessionClient","require","_sessionClientHost","_tokenTransport","_projectSessionState"],"sourceRoot":"../../../../src","sources":["ui/session/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,IAAAA,oBAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AACA,IAAAG,oBAAA,GAAAH,OAAA","ignoreList":[]}
1
+ {"version":3,"names":["_createSessionClient","require","_tokenTransport","_authStore","_core"],"sourceRoot":"../../../../src","sources":["ui/session/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,IAAAA,oBAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA","ignoreList":[]}
@@ -5,40 +5,25 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.createTokenTransport = createTokenTransport;
7
7
  var _core = require("@oxyhq/core");
8
- var _useWebSSO = require("../hooks/useWebSSO.js");
9
8
  /**
10
- * Platform `TokenTransport` for `SessionClient`: mints an access token when
11
- * none is currently held, reusing the SAME primitives `OxyContext`'s cold
12
- * boot already relies on (never re-implemented here):
9
+ * Platform `TokenTransport` for `SessionClient` (device-first model).
13
10
  *
14
- * - web: `oxyServices.silentSignIn()` (per-apex `/auth/silent` iframe).
15
- * - native: `oxyServices.signInWithSharedIdentity()` (app-group keychain).
11
+ * `ensureActiveToken` is the fallback the client uses when a `session_state`
12
+ * push arrived WITHOUT an embedded `activeToken` and the app currently holds no
13
+ * bearer. It mints one through the ONE unified refresh path
14
+ * (`refreshPersistedSession`): rotate the persisted refresh-token family
15
+ * (`POST /auth/refresh-token`) and, on native, fall back to the shared-keychain
16
+ * re-mint. There is no FedCM/silent-iframe arm anymore — the per-origin
17
+ * persisted refresh token is the durable web credential.
16
18
  *
17
- * Both primitives plant the token internally on success (the "Sign-In Token
18
- * Planting" rule) `ensureActiveToken` never calls `setTokens` itself.
19
- *
20
- * `ensureActiveToken` treats a PRESENT token as sufficient in this phase; it
21
- * does not decode/match the token's subject against `state.activeAccountId`
22
- * (that refinement is Fase 3-B). Account switching itself is server-driven
23
- * via the `activeToken` carried in the sync envelope — this transport is
24
- * only the fallback used when the envelope carried no token.
25
- *
26
- * A failed mint is logged and swallowed: it must never throw out of
27
- * `ensureActiveToken`, since that would crash the caller (the SessionClient
28
- * socket handler in Fase 3-B).
19
+ * Concurrent pushes coalesce onto one in-flight mint. A failure is logged and
20
+ * swallowed: this method must never throw out (it runs inside the socket state
21
+ * handler).
29
22
  */
30
- function createTokenTransport(oxyServices) {
31
- // Coalesces concurrent mints: `SessionClient.applyState` can fire
32
- // `ensureActiveToken` on rapid successive state pushes; a second call while a
33
- // mint is already in flight must reuse it, not spawn a second silent iframe /
34
- // shared-key challenge round-trip.
23
+ function createTokenTransport(oxyServices, store) {
35
24
  let inFlightMint = null;
36
25
  return {
37
26
  async ensureActiveToken(state) {
38
- // Read the current token defensively: it is an in-memory getter that
39
- // should never throw, but the documented contract is that this method
40
- // never throws out — so a surprising throw is logged and treated as "no
41
- // token" (fall through to mint) rather than rejecting the promise.
42
27
  try {
43
28
  if (oxyServices.getAccessToken()) {
44
29
  return;
@@ -53,15 +38,18 @@ function createTokenTransport(oxyServices) {
53
38
  }
54
39
  inFlightMint = (async () => {
55
40
  try {
56
- const session = (0, _useWebSSO.isWebBrowser)() ? await oxyServices.silentSignIn() : await oxyServices.signInWithSharedIdentity();
57
- if (!session) {
58
- _core.logger.debug('ensureActiveToken: platform mint returned no session', {
41
+ const token = await (0, _core.refreshPersistedSession)({
42
+ oxy: oxyServices,
43
+ store
44
+ });
45
+ if (!token) {
46
+ _core.logger.debug('ensureActiveToken: refresh produced no session', {
59
47
  component: 'TokenTransport',
60
48
  deviceId: state.deviceId
61
49
  });
62
50
  }
63
51
  } catch (error) {
64
- _core.logger.warn('ensureActiveToken: mint failed', {
52
+ _core.logger.warn('ensureActiveToken: refresh failed', {
65
53
  component: 'TokenTransport'
66
54
  }, error);
67
55
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_core","require","_useWebSSO","createTokenTransport","oxyServices","inFlightMint","ensureActiveToken","state","getAccessToken","error","logger","warn","component","session","isWebBrowser","silentSignIn","signInWithSharedIdentity","debug","deviceId"],"sourceRoot":"../../../../src","sources":["ui/session/tokenTransport.ts"],"mappings":";;;;;;AAEA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,oBAAoBA,CAACC,WAAwB,EAAkB;EAC7E;EACA;EACA;EACA;EACA,IAAIC,YAAkC,GAAG,IAAI;EAE7C,OAAO;IACL,MAAMC,iBAAiBA,CAACC,KAAyB,EAAiB;MAChE;MACA;MACA;MACA;MACA,IAAI;QACF,IAAIH,WAAW,CAACI,cAAc,CAAC,CAAC,EAAE;UAChC;QACF;MACF,CAAC,CAAC,OAAOC,KAAK,EAAE;QACdC,YAAM,CAACC,IAAI,CAAC,yCAAyC,EAAE;UAAEC,SAAS,EAAE;QAAiB,CAAC,EAAEH,KAAK,CAAC;MAChG;MAEA,IAAIJ,YAAY,EAAE;QAChB,OAAOA,YAAY;MACrB;MAEAA,YAAY,GAAG,CAAC,YAAY;QAC1B,IAAI;UACF,MAAMQ,OAAO,GAAG,IAAAC,uBAAY,EAAC,CAAC,GAC1B,MAAMV,WAAW,CAACW,YAAY,CAAC,CAAC,GAChC,MAAMX,WAAW,CAACY,wBAAwB,CAAC,CAAC;UAEhD,IAAI,CAACH,OAAO,EAAE;YACZH,YAAM,CAACO,KAAK,CAAC,sDAAsD,EAAE;cACnEL,SAAS,EAAE,gBAAgB;cAC3BM,QAAQ,EAAEX,KAAK,CAACW;YAClB,CAAC,CAAC;UACJ;QACF,CAAC,CAAC,OAAOT,KAAK,EAAE;UACdC,YAAM,CAACC,IAAI,CAAC,gCAAgC,EAAE;YAAEC,SAAS,EAAE;UAAiB,CAAC,EAAEH,KAAK,CAAC;QACvF;MACF,CAAC,EAAE,CAAC;MAEJ,IAAI;QACF,MAAMJ,YAAY;MACpB,CAAC,SAAS;QACRA,YAAY,GAAG,IAAI;MACrB;IACF;EACF,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"names":["_core","require","createTokenTransport","oxyServices","store","inFlightMint","ensureActiveToken","state","getAccessToken","error","logger","warn","component","token","refreshPersistedSession","oxy","debug","deviceId"],"sourceRoot":"../../../../src","sources":["ui/session/tokenTransport.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,oBAAoBA,CAClCC,WAAwB,EACxBC,KAAqB,EACL;EAChB,IAAIC,YAAkC,GAAG,IAAI;EAE7C,OAAO;IACL,MAAMC,iBAAiBA,CAACC,KAAyB,EAAiB;MAChE,IAAI;QACF,IAAIJ,WAAW,CAACK,cAAc,CAAC,CAAC,EAAE;UAChC;QACF;MACF,CAAC,CAAC,OAAOC,KAAK,EAAE;QACdC,YAAM,CAACC,IAAI,CAAC,yCAAyC,EAAE;UAAEC,SAAS,EAAE;QAAiB,CAAC,EAAEH,KAAK,CAAC;MAChG;MAEA,IAAIJ,YAAY,EAAE;QAChB,OAAOA,YAAY;MACrB;MAEAA,YAAY,GAAG,CAAC,YAAY;QAC1B,IAAI;UACF,MAAMQ,KAAK,GAAG,MAAM,IAAAC,6BAAuB,EAAC;YAAEC,GAAG,EAAEZ,WAAW;YAAEC;UAAM,CAAC,CAAC;UACxE,IAAI,CAACS,KAAK,EAAE;YACVH,YAAM,CAACM,KAAK,CAAC,gDAAgD,EAAE;cAC7DJ,SAAS,EAAE,gBAAgB;cAC3BK,QAAQ,EAAEV,KAAK,CAACU;YAClB,CAAC,CAAC;UACJ;QACF,CAAC,CAAC,OAAOR,KAAK,EAAE;UACdC,YAAM,CAACC,IAAI,CAAC,mCAAmC,EAAE;YAAEC,SAAS,EAAE;UAAiB,CAAC,EAAEH,KAAK,CAAC;QAC1F;MACF,CAAC,EAAE,CAAC;MAEJ,IAAI;QACF,MAAMJ,YAAY;MACpB,CAAC,SAAS;QACRA,YAAY,GAAG,IAAI;MACrB;IACF;EACF,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "isWebBrowser", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _core.isWebBrowser;
10
+ }
11
+ });
12
+ var _core = require("@oxyhq/core");
13
+ //# sourceMappingURL=isWebBrowser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_core","require"],"sourceRoot":"../../../../src","sources":["ui/utils/isWebBrowser.ts"],"mappings":";;;;;;;;;;;AAOA,IAAAA,KAAA,GAAAC,OAAA","ignoreList":[]}
@@ -44,8 +44,6 @@ var _core = require("@oxyhq/core");
44
44
  * trivially unit-testable with a stub and never pulls the RN/Expo runtime into
45
45
  * a test bundle.
46
46
  *
47
- * Extends {@link SsoEstablishClient} (`requestSsoEstablishUrl`) so the WEB
48
- * post-claim durable-session hop can be driven off the same client.
49
47
  */
50
48
 
51
49
  /**
@@ -61,8 +59,7 @@ async function completeDeviceFlowSignIn({
61
59
  oxyServices,
62
60
  sessionId,
63
61
  sessionToken,
64
- commitSession,
65
- establishDeps
62
+ commitSession
66
63
  }) {
67
64
  // 1) Plant the bearer + refresh tokens. The claim response is also persisted
68
65
  // to native shared secure storage so a later cold boot has a bearer before
@@ -88,25 +85,25 @@ async function completeDeviceFlowSignIn({
88
85
 
89
86
  // 2) Bearer is now planted — commit the session through the same path a
90
87
  // fresh sign-in uses so it is registered into the device's
91
- // server-authoritative session set instead of an account switch.
88
+ // server-authoritative session set instead of an account switch. Thread
89
+ // the rotating refresh token so the commit funnel persists a durable
90
+ // session that survives a reload.
92
91
  await commitSession({
93
92
  sessionId: claimed.sessionId || sessionId,
94
93
  deviceId: claimed.deviceId ?? '',
95
94
  expiresAt: claimed.expiresAt ?? '',
96
95
  user: minimalUser,
97
- accessToken: claimed.accessToken
96
+ accessToken: claimed.accessToken,
97
+ ...(claimed.refreshToken ? {
98
+ refreshToken: claimed.refreshToken
99
+ } : {})
98
100
  });
99
101
 
100
- // 3) WEB durable-session hop (no-op on native). A device-flow claim plants
101
- // ONLY in-memory tokens no IdP `fedcm_session` cookie is ever planted, so
102
- // a reload cannot re-mint a token and the session is lost. Now that the
103
- // session is committed AND durably persisted (step 2), plant the per-apex
104
- // IdP cookie via ONE top-level establish hop. Single attempt; total (never
105
- // throws) — an establish failure leaves the committed session as-is. On web
106
- // success it navigates away, so it is the LAST step: the browser tears the
107
- // page down on the next tick, after `claimed.user` is returned to the
108
- // caller's `onSignedIn`.
109
- await (0, _core.establishIdpSessionAfterClaim)(oxyServices, establishDeps ?? {});
102
+ // The commit funnel persisted the rotating refresh family and registered the
103
+ // account into the device set, so a reload restores the session locally (web:
104
+ // stored-tokens / same-apex web-session; native: shared keychain) WITHOUT any
105
+ // IdP `fedcm_session` cookie or top-level establish hop.
106
+
110
107
  return claimed.user;
111
108
  }
112
109
  //# sourceMappingURL=deviceFlowSignIn.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_core","require","completeDeviceFlowSignIn","oxyServices","sessionId","sessionToken","commitSession","establishDeps","claimed","claimSessionByToken","accessToken","KeyManager","storeSharedSession","user","Error","minimalUser","id","username","name","avatar","undefined","deviceId","expiresAt","establishIdpSessionAfterClaim"],"sourceRoot":"../../../src","sources":["utils/deviceFlowSignIn.ts"],"mappings":";;;;;;AAiCA,IAAAA,KAAA,GAAAC,OAAA;AAjCA;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;;AAoBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAqCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,eAAeC,wBAAwBA,CAAC;EAC7CC,WAAW;EACXC,SAAS;EACTC,YAAY;EACZC,aAAa;EACbC;AAC+B,CAAC,EAAiB;EACjD;EACA;EACA;EACA,MAAMC,OAAO,GAAG,MAAML,WAAW,CAACM,mBAAmB,CAACJ,YAAY,CAAC;EACnE,IAAIG,OAAO,EAAEE,WAAW,EAAE;IACxB,MAAMC,gBAAU,CAACC,kBAAkB,CAACJ,OAAO,CAACJ,SAAS,IAAIA,SAAS,EAAEI,OAAO,CAACE,WAAW,CAAC;EAC1F;EAEA,IAAI,CAACF,OAAO,EAAEE,WAAW,IAAI,CAACF,OAAO,CAACK,IAAI,EAAE;IAC1C,MAAM,IAAIC,KAAK,CAAC,mDAAmD,CAAC;EACtE;;EAEA;EACA;EACA;EACA;EACA,MAAMC,WAA4B,GAAG;IACnCC,EAAE,EAAER,OAAO,CAACK,IAAI,CAACG,EAAE;IACnBC,QAAQ,EAAET,OAAO,CAACK,IAAI,CAACI,QAAQ;IAC/BC,IAAI,EAAEV,OAAO,CAACK,IAAI,CAACK,IAAI;IACvBC,MAAM,EAAEX,OAAO,CAACK,IAAI,CAACM,MAAM,IAAIC;EACjC,CAAC;;EAED;EACA;EACA;EACA,MAAMd,aAAa,CAAC;IAClBF,SAAS,EAAEI,OAAO,CAACJ,SAAS,IAAIA,SAAS;IACzCiB,QAAQ,EAAEb,OAAO,CAACa,QAAQ,IAAI,EAAE;IAChCC,SAAS,EAAEd,OAAO,CAACc,SAAS,IAAI,EAAE;IAClCT,IAAI,EAAEE,WAAW;IACjBL,WAAW,EAAEF,OAAO,CAACE;EACvB,CAAC,CAAC;;EAEF;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,MAAM,IAAAa,mCAA6B,EAACpB,WAAW,EAAEI,aAAa,IAAI,CAAC,CAAC,CAAC;EAErE,OAAOC,OAAO,CAACK,IAAI;AACrB","ignoreList":[]}
1
+ {"version":3,"names":["_core","require","completeDeviceFlowSignIn","oxyServices","sessionId","sessionToken","commitSession","claimed","claimSessionByToken","accessToken","KeyManager","storeSharedSession","user","Error","minimalUser","id","username","name","avatar","undefined","deviceId","expiresAt","refreshToken"],"sourceRoot":"../../../src","sources":["utils/deviceFlowSignIn.ts"],"mappings":";;;;;;AAiCA,IAAAA,KAAA,GAAAC,OAAA;AAjCA;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;;AAsBA;AACA;AACA;AACA;AACA;AACA;AACA;;AAkCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,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,MAAMC,gBAAU,CAACC,kBAAkB,CAACJ,OAAO,CAACH,SAAS,IAAIA,SAAS,EAAEG,OAAO,CAACE,WAAW,CAAC;EAC1F;EAEA,IAAI,CAACF,OAAO,EAAEE,WAAW,IAAI,CAACF,OAAO,CAACK,IAAI,EAAE;IAC1C,MAAM,IAAIC,KAAK,CAAC,mDAAmD,CAAC;EACtE;;EAEA;EACA;EACA;EACA;EACA,MAAMC,WAA4B,GAAG;IACnCC,EAAE,EAAER,OAAO,CAACK,IAAI,CAACG,EAAE;IACnBC,QAAQ,EAAET,OAAO,CAACK,IAAI,CAACI,QAAQ;IAC/BC,IAAI,EAAEV,OAAO,CAACK,IAAI,CAACK,IAAI;IACvBC,MAAM,EAAEX,OAAO,CAACK,IAAI,CAACM,MAAM,IAAIC;EACjC,CAAC;;EAED;EACA;EACA;EACA;EACA;EACA,MAAMb,aAAa,CAAC;IAClBF,SAAS,EAAEG,OAAO,CAACH,SAAS,IAAIA,SAAS;IACzCgB,QAAQ,EAAEb,OAAO,CAACa,QAAQ,IAAI,EAAE;IAChCC,SAAS,EAAEd,OAAO,CAACc,SAAS,IAAI,EAAE;IAClCT,IAAI,EAAEE,WAAW;IACjBL,WAAW,EAAEF,OAAO,CAACE,WAAW;IAChC,IAAIF,OAAO,CAACe,YAAY,GAAG;MAAEA,YAAY,EAAEf,OAAO,CAACe;IAAa,CAAC,GAAG,CAAC,CAAC;EACxE,CAAC,CAAC;;EAEF;EACA;EACA;EACA;;EAEA,OAAOf,OAAO,CAACK,IAAI;AACrB","ignoreList":[]}
@@ -89,11 +89,6 @@ export { useOnlineStatus } from "./ui/hooks/useOnlineStatus.js";
89
89
  // Error handlers
90
90
  // ---------------------------------------------------------------------------
91
91
  export { handleAuthError, isInvalidSessionError, isTimeoutOrNetworkError, extractErrorMessage } from "./ui/utils/errorHandlers.js";
92
- // Thrown by `signInWithPassword` / `signIn` on a cross-apex web RP, where a
93
- // direct (non-IdP) sign-in would not survive a page reload — apps catch it to
94
- // route the user to the durable "Continue with Oxy" IdP flow.
95
- export { CrossApexDirectSignInError, isCrossApexWeb } from "./utils/crossApex.js";
96
-
97
92
  // ---------------------------------------------------------------------------
98
93
  // File filtering
99
94
  // ---------------------------------------------------------------------------
@@ -1 +1 @@
1
- {"version":3,"names":["setPlatformOS","Platform","OS","default","OxyProvider","useOxy","useAuth","FontLoader","useAuthStore","useAssetStore","useAssets","useAssetsStore","useAsset","useUploadProgress","useAssetLoading","useAssetErrors","useAssetsByApp","useAssetsByEntity","useAssetUsageCount","useIsAssetLinked","setOxyAssetInstance","useFileDownloadUrl","useFollow","useFollowerCounts","useUserProfile","useUserProfiles","useCurrentUser","useUserById","useUserByUsername","useUsersBySessions","usePrivacySettings","useAuthorizedApps","useSessions","useSession","useDeviceSessions","useUserDevices","useSecurityInfo","useAccountStorageUsage","useSecurityActivity","useRecentSecurityActivity","useInfiniteSecurityActivity","useUserSubscription","useUserPayments","useUserWallet","useUserWalletTransactions","useUpdateProfile","useUploadAvatar","useUpdateAccountSettings","useUpdatePrivacySettings","useUpdateNotificationPreferences","useUpdateUserPreferences","useRevokeAuthorizedApp","useUploadFile","useSwitchSession","useLogoutSession","useLogoutAll","useUpdateDeviceName","useRemoveDevice","createProfileMutation","createGenericMutation","mutationKeys","queryKeys","invalidateAccountQueries","invalidateUserQueries","invalidateSessionQueries","invalidateDeviceQueries","invalidatePrivacyQueries","invalidateSecurityQueries","invalidateStorageQueries","invalidatePaymentsQueries","invalidateConnectedAppsQueries","useMutationStatus","useOnlineStatus","handleAuthError","isInvalidSessionError","isTimeoutOrNetworkError","extractErrorMessage","CrossApexDirectSignInError","isCrossApexWeb","useFileFiltering","Avatar","OxySignInButton","OxyAuthPrompt","OxyLogo","FollowButton","LogoIcon","LogoText","AccountMenu","AccountMenuButton","ProfileButton","ProfileMenu","AccountSwitcher","AccountSwitcherView","useSwitchableAccounts","ManageAccountScreen","NotificationsScreen","PreferencesScreen","ConnectedAppsScreen","AccountSwitcherScreen","CreateAccountScreen","AccountMembersScreen","AccountSettingsScreen","showBottomSheet","closeBottomSheet","showSignInModal","hideSignInModal"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;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;AAExE,SAAStF,OAAO,IAAIuF,WAAW,QAAQ,gCAA6B;AAGpE;AACA;AACA;AACA,SAASvF,OAAO,IAAIwF,eAAe,EAAEC,mBAAmB,QAAQ,oCAAiC;AAGjG;AACA;AACA;AACA;AACA,SAASC,qBAAqB,QAAQ,qCAAkC;AAOxE;AACA,SAAS1F,OAAO,IAAI2F,mBAAmB,QAAQ,qCAAkC;AACjF,SAAS3F,OAAO,IAAI4F,mBAAmB,QAAQ,qCAAkC;AACjF,SAAS5F,OAAO,IAAI6F,iBAAiB,QAAQ,mCAAgC;AAC7E,SAAS7F,OAAO,IAAI8F,mBAAmB,QAAQ,qCAAkC;;AAEjF;AACA,SAAS9F,OAAO,IAAI+F,qBAAqB,QAAQ,uCAAoC;AACrF,SAAS/F,OAAO,IAAIgG,mBAAmB,QAAQ,qCAAkC;AACjF,SAAShG,OAAO,IAAIiG,oBAAoB,QAAQ,sCAAmC;AACnF,SAASjG,OAAO,IAAIkG,qBAAqB,QAAQ,uCAAoC;;AAErF;AACA;AACA;AACA,SAASC,eAAe,EAAEC,gBAAgB,QAAQ,uCAAoC;AAGtF;AACA;AACA;AACA,SAASC,eAAe,EAAEC,eAAe,QAAQ,gCAA6B","ignoreList":[]}
1
+ {"version":3,"names":["setPlatformOS","Platform","OS","default","OxyProvider","useOxy","useAuth","FontLoader","useAuthStore","useAssetStore","useAssets","useAssetsStore","useAsset","useUploadProgress","useAssetLoading","useAssetErrors","useAssetsByApp","useAssetsByEntity","useAssetUsageCount","useIsAssetLinked","setOxyAssetInstance","useFileDownloadUrl","useFollow","useFollowerCounts","useUserProfile","useUserProfiles","useCurrentUser","useUserById","useUserByUsername","useUsersBySessions","usePrivacySettings","useAuthorizedApps","useSessions","useSession","useDeviceSessions","useUserDevices","useSecurityInfo","useAccountStorageUsage","useSecurityActivity","useRecentSecurityActivity","useInfiniteSecurityActivity","useUserSubscription","useUserPayments","useUserWallet","useUserWalletTransactions","useUpdateProfile","useUploadAvatar","useUpdateAccountSettings","useUpdatePrivacySettings","useUpdateNotificationPreferences","useUpdateUserPreferences","useRevokeAuthorizedApp","useUploadFile","useSwitchSession","useLogoutSession","useLogoutAll","useUpdateDeviceName","useRemoveDevice","createProfileMutation","createGenericMutation","mutationKeys","queryKeys","invalidateAccountQueries","invalidateUserQueries","invalidateSessionQueries","invalidateDeviceQueries","invalidatePrivacyQueries","invalidateSecurityQueries","invalidateStorageQueries","invalidatePaymentsQueries","invalidateConnectedAppsQueries","useMutationStatus","useOnlineStatus","handleAuthError","isInvalidSessionError","isTimeoutOrNetworkError","extractErrorMessage","useFileFiltering","Avatar","OxySignInButton","OxyAuthPrompt","OxyLogo","FollowButton","LogoIcon","LogoText","AccountMenu","AccountMenuButton","ProfileButton","ProfileMenu","AccountSwitcher","AccountSwitcherView","useSwitchableAccounts","ManageAccountScreen","NotificationsScreen","PreferencesScreen","ConnectedAppsScreen","AccountSwitcherScreen","CreateAccountScreen","AccountMembersScreen","AccountSettingsScreen","showBottomSheet","closeBottomSheet","showSignInModal","hideSignInModal"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,SAASA,aAAa,QAAyB,aAAa;AAC5D,SAASC,QAAQ,QAAQ,cAAc;AACvCD,aAAa,CAACC,QAAQ,CAACC,EAAgB,CAAC;;AAExC;AACA;AACA;AACA,SAASC,OAAO,IAAIC,WAAW,QAAQ,gCAA6B;AACpE,SAASC,MAAM,QAAQ,4BAAyB;AAEhD,SAASC,OAAO,QAAQ,uBAAoB;AAG5C;AACA;AACA;AACA,SAASC,UAAU,QAAQ,+BAA4B;;AAEvD;AACA;AACA;AACA,SAASC,YAAY,QAAQ,0BAAuB;AACpD,SACIC,aAAa,EACbC,SAAS,IAAIC,cAAc,EAC3BC,QAAQ,EACRC,iBAAiB,EACjBC,eAAe,EACfC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