@oxy.so/services 14.10.1 → 14.12.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 (160) hide show
  1. package/lib/commonjs/assets/assets/fonts/icons/OxyServicesIonicons.ttf +0 -0
  2. package/lib/commonjs/assets/assets/fonts/icons/OxyServicesMaterialCommunityIcons.ttf +0 -0
  3. package/lib/commonjs/assets/assets/fonts/icons/manifest.json +5 -4
  4. package/lib/commonjs/assets/fonts/icons/OxyServicesIonicons.ttf +0 -0
  5. package/lib/commonjs/assets/fonts/icons/OxyServicesMaterialCommunityIcons.ttf +0 -0
  6. package/lib/commonjs/assets/fonts/icons/manifest.json +5 -4
  7. package/lib/commonjs/index.js +10 -0
  8. package/lib/commonjs/index.js.map +1 -1
  9. package/lib/commonjs/ui/boot/runProviderColdBoot.js +3 -1
  10. package/lib/commonjs/ui/boot/runProviderColdBoot.js.map +1 -1
  11. package/lib/commonjs/ui/components/OxyProvider.js +52 -18
  12. package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
  13. package/lib/commonjs/ui/context/OxyContext.js +15 -5
  14. package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
  15. package/lib/commonjs/ui/context/OxyHostedContext.js +515 -0
  16. package/lib/commonjs/ui/context/OxyHostedContext.js.map +1 -0
  17. package/lib/commonjs/ui/context/oxyRuntimeContext.js.map +1 -1
  18. package/lib/commonjs/ui/hooks/useAuth.js +13 -2
  19. package/lib/commonjs/ui/hooks/useAuth.js.map +1 -1
  20. package/lib/commonjs/ui/hooks/useOxyEvent.js +9 -5
  21. package/lib/commonjs/ui/hooks/useOxyEvent.js.map +1 -1
  22. package/lib/commonjs/ui/icons/subsetGlyphMaps.js +1 -0
  23. package/lib/commonjs/ui/icons/subsetGlyphMaps.js.map +1 -1
  24. package/lib/commonjs/ui/screens/EditProfileFieldScreen.js +16 -63
  25. package/lib/commonjs/ui/screens/EditProfileFieldScreen.js.map +1 -1
  26. package/lib/commonjs/ui/screens/ProfileLinkForm.js +125 -0
  27. package/lib/commonjs/ui/screens/ProfileLinkForm.js.map +1 -0
  28. package/lib/commonjs/ui/screens/ProfileLinksEditor.js +85 -0
  29. package/lib/commonjs/ui/screens/ProfileLinksEditor.js.map +1 -0
  30. package/lib/commonjs/ui/screens/linkFormat.js +22 -10
  31. package/lib/commonjs/ui/screens/linkFormat.js.map +1 -1
  32. package/lib/commonjs/ui/session/hostSession.js +474 -0
  33. package/lib/commonjs/ui/session/hostSession.js.map +1 -0
  34. package/lib/module/assets/assets/fonts/icons/OxyServicesIonicons.ttf +0 -0
  35. package/lib/module/assets/assets/fonts/icons/OxyServicesMaterialCommunityIcons.ttf +0 -0
  36. package/lib/module/assets/assets/fonts/icons/manifest.json +5 -4
  37. package/lib/module/assets/fonts/icons/OxyServicesIonicons.ttf +0 -0
  38. package/lib/module/assets/fonts/icons/OxyServicesMaterialCommunityIcons.ttf +0 -0
  39. package/lib/module/assets/fonts/icons/manifest.json +5 -4
  40. package/lib/module/index.js +3 -0
  41. package/lib/module/index.js.map +1 -1
  42. package/lib/module/ui/boot/runProviderColdBoot.js +3 -1
  43. package/lib/module/ui/boot/runProviderColdBoot.js.map +1 -1
  44. package/lib/module/ui/components/OxyProvider.js +53 -19
  45. package/lib/module/ui/components/OxyProvider.js.map +1 -1
  46. package/lib/module/ui/context/OxyContext.js +15 -5
  47. package/lib/module/ui/context/OxyContext.js.map +1 -1
  48. package/lib/module/ui/context/OxyHostedContext.js +510 -0
  49. package/lib/module/ui/context/OxyHostedContext.js.map +1 -0
  50. package/lib/module/ui/context/oxyRuntimeContext.js.map +1 -1
  51. package/lib/module/ui/hooks/useAuth.js +13 -2
  52. package/lib/module/ui/hooks/useAuth.js.map +1 -1
  53. package/lib/module/ui/hooks/useOxyEvent.js +9 -5
  54. package/lib/module/ui/hooks/useOxyEvent.js.map +1 -1
  55. package/lib/module/ui/icons/subsetGlyphMaps.js +1 -0
  56. package/lib/module/ui/icons/subsetGlyphMaps.js.map +1 -1
  57. package/lib/module/ui/screens/EditProfileFieldScreen.js +17 -65
  58. package/lib/module/ui/screens/EditProfileFieldScreen.js.map +1 -1
  59. package/lib/module/ui/screens/ProfileLinkForm.js +121 -0
  60. package/lib/module/ui/screens/ProfileLinkForm.js.map +1 -0
  61. package/lib/module/ui/screens/ProfileLinksEditor.js +81 -0
  62. package/lib/module/ui/screens/ProfileLinksEditor.js.map +1 -0
  63. package/lib/module/ui/screens/linkFormat.js +21 -9
  64. package/lib/module/ui/screens/linkFormat.js.map +1 -1
  65. package/lib/module/ui/session/hostSession.js +467 -0
  66. package/lib/module/ui/session/hostSession.js.map +1 -0
  67. package/lib/typescript/commonjs/index.d.ts +1 -0
  68. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  69. package/lib/typescript/commonjs/ui/boot/runProviderColdBoot.d.ts +6 -0
  70. package/lib/typescript/commonjs/ui/boot/runProviderColdBoot.d.ts.map +1 -1
  71. package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts.map +1 -1
  72. package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
  73. package/lib/typescript/commonjs/ui/context/OxyHostedContext.d.ts +40 -0
  74. package/lib/typescript/commonjs/ui/context/OxyHostedContext.d.ts.map +1 -0
  75. package/lib/typescript/commonjs/ui/context/oxyContextTypes.d.ts +19 -2
  76. package/lib/typescript/commonjs/ui/context/oxyContextTypes.d.ts.map +1 -1
  77. package/lib/typescript/commonjs/ui/context/oxyRuntimeContext.d.ts +6 -0
  78. package/lib/typescript/commonjs/ui/context/oxyRuntimeContext.d.ts.map +1 -1
  79. package/lib/typescript/commonjs/ui/hooks/useAuth.d.ts +3 -0
  80. package/lib/typescript/commonjs/ui/hooks/useAuth.d.ts.map +1 -1
  81. package/lib/typescript/commonjs/ui/hooks/useOxyEvent.d.ts.map +1 -1
  82. package/lib/typescript/commonjs/ui/icons/Ionicons.d.ts +1 -1
  83. package/lib/typescript/commonjs/ui/icons/Ionicons.d.ts.map +1 -1
  84. package/lib/typescript/commonjs/ui/icons/subsetGlyphMaps.d.ts +1 -0
  85. package/lib/typescript/commonjs/ui/icons/subsetGlyphMaps.d.ts.map +1 -1
  86. package/lib/typescript/commonjs/ui/screens/EditProfileFieldScreen.d.ts.map +1 -1
  87. package/lib/typescript/commonjs/ui/screens/ProfileLinkForm.d.ts +18 -0
  88. package/lib/typescript/commonjs/ui/screens/ProfileLinkForm.d.ts.map +1 -0
  89. package/lib/typescript/commonjs/ui/screens/ProfileLinksEditor.d.ts +14 -0
  90. package/lib/typescript/commonjs/ui/screens/ProfileLinksEditor.d.ts.map +1 -0
  91. package/lib/typescript/commonjs/ui/screens/linkFormat.d.ts +14 -2
  92. package/lib/typescript/commonjs/ui/screens/linkFormat.d.ts.map +1 -1
  93. package/lib/typescript/commonjs/ui/session/hostSession.d.ts +69 -0
  94. package/lib/typescript/commonjs/ui/session/hostSession.d.ts.map +1 -0
  95. package/lib/typescript/commonjs/ui/types/navigation.d.ts +24 -1
  96. package/lib/typescript/commonjs/ui/types/navigation.d.ts.map +1 -1
  97. package/lib/typescript/commonjs/ui/utils/identityCrypto.d.ts +4 -0
  98. package/lib/typescript/commonjs/ui/utils/identityCrypto.d.ts.map +1 -1
  99. package/lib/typescript/module/index.d.ts +1 -0
  100. package/lib/typescript/module/index.d.ts.map +1 -1
  101. package/lib/typescript/module/ui/boot/runProviderColdBoot.d.ts +6 -0
  102. package/lib/typescript/module/ui/boot/runProviderColdBoot.d.ts.map +1 -1
  103. package/lib/typescript/module/ui/components/OxyProvider.d.ts.map +1 -1
  104. package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
  105. package/lib/typescript/module/ui/context/OxyHostedContext.d.ts +40 -0
  106. package/lib/typescript/module/ui/context/OxyHostedContext.d.ts.map +1 -0
  107. package/lib/typescript/module/ui/context/oxyContextTypes.d.ts +19 -2
  108. package/lib/typescript/module/ui/context/oxyContextTypes.d.ts.map +1 -1
  109. package/lib/typescript/module/ui/context/oxyRuntimeContext.d.ts +6 -0
  110. package/lib/typescript/module/ui/context/oxyRuntimeContext.d.ts.map +1 -1
  111. package/lib/typescript/module/ui/hooks/useAuth.d.ts +3 -0
  112. package/lib/typescript/module/ui/hooks/useAuth.d.ts.map +1 -1
  113. package/lib/typescript/module/ui/hooks/useOxyEvent.d.ts.map +1 -1
  114. package/lib/typescript/module/ui/icons/Ionicons.d.ts +1 -1
  115. package/lib/typescript/module/ui/icons/Ionicons.d.ts.map +1 -1
  116. package/lib/typescript/module/ui/icons/subsetGlyphMaps.d.ts +1 -0
  117. package/lib/typescript/module/ui/icons/subsetGlyphMaps.d.ts.map +1 -1
  118. package/lib/typescript/module/ui/screens/EditProfileFieldScreen.d.ts.map +1 -1
  119. package/lib/typescript/module/ui/screens/ProfileLinkForm.d.ts +18 -0
  120. package/lib/typescript/module/ui/screens/ProfileLinkForm.d.ts.map +1 -0
  121. package/lib/typescript/module/ui/screens/ProfileLinksEditor.d.ts +14 -0
  122. package/lib/typescript/module/ui/screens/ProfileLinksEditor.d.ts.map +1 -0
  123. package/lib/typescript/module/ui/screens/linkFormat.d.ts +14 -2
  124. package/lib/typescript/module/ui/screens/linkFormat.d.ts.map +1 -1
  125. package/lib/typescript/module/ui/session/hostSession.d.ts +69 -0
  126. package/lib/typescript/module/ui/session/hostSession.d.ts.map +1 -0
  127. package/lib/typescript/module/ui/types/navigation.d.ts +24 -1
  128. package/lib/typescript/module/ui/types/navigation.d.ts.map +1 -1
  129. package/lib/typescript/module/ui/utils/identityCrypto.d.ts +4 -0
  130. package/lib/typescript/module/ui/utils/identityCrypto.d.ts.map +1 -1
  131. package/package.json +7 -7
  132. package/src/assets/fonts/icons/OxyServicesIonicons.ttf +0 -0
  133. package/src/assets/fonts/icons/OxyServicesMaterialCommunityIcons.ttf +0 -0
  134. package/src/assets/fonts/icons/manifest.json +5 -4
  135. package/src/index.ts +3 -0
  136. package/src/ui/boot/runProviderColdBoot.ts +12 -1
  137. package/src/ui/components/OxyProvider.tsx +77 -34
  138. package/src/ui/context/OxyContext.tsx +19 -4
  139. package/src/ui/context/OxyHostedContext.tsx +678 -0
  140. package/src/ui/context/oxyContextTypes.ts +21 -2
  141. package/src/ui/context/oxyRuntimeContext.ts +9 -1
  142. package/src/ui/hooks/useAuth.ts +13 -1
  143. package/src/ui/hooks/useOxyEvent.ts +8 -5
  144. package/src/ui/icons/subsetGlyphMaps.ts +1 -0
  145. package/src/ui/screens/EditProfileFieldScreen.tsx +19 -85
  146. package/src/ui/screens/ProfileLinkForm.tsx +131 -0
  147. package/src/ui/screens/ProfileLinksEditor.tsx +98 -0
  148. package/src/ui/screens/__tests__/linkFormat.test.ts +51 -8
  149. package/src/ui/screens/linkFormat.ts +28 -9
  150. package/src/ui/session/hostSession.ts +515 -0
  151. package/src/ui/types/navigation.ts +24 -1
  152. package/lib/commonjs/ui/screens/LinkListEditor.js +0 -105
  153. package/lib/commonjs/ui/screens/LinkListEditor.js.map +0 -1
  154. package/lib/module/ui/screens/LinkListEditor.js +0 -99
  155. package/lib/module/ui/screens/LinkListEditor.js.map +0 -1
  156. package/lib/typescript/commonjs/ui/screens/LinkListEditor.d.ts +0 -25
  157. package/lib/typescript/commonjs/ui/screens/LinkListEditor.d.ts.map +0 -1
  158. package/lib/typescript/module/ui/screens/LinkListEditor.d.ts +0 -25
  159. package/lib/typescript/module/ui/screens/LinkListEditor.d.ts.map +0 -1
  160. package/src/ui/screens/LinkListEditor.tsx +0 -113
@@ -4,6 +4,8 @@ import { AppState, Platform, StyleSheet } from 'react-native';
4
4
  import { GestureHandlerRootView } from 'react-native-gesture-handler';
5
5
  import type { OxyProviderProps } from '../types/navigation';
6
6
  import { OxyRuntimeProvider, type OxyRuntimeProviderProps } from '../context/OxyContext';
7
+ import { OxyHostedRuntimeProvider } from '../context/OxyHostedContext';
8
+ import { getOxySessionHost } from '@oxy.so/core/host';
7
9
  import { QueryClientProvider, focusManager, onlineManager } from '@tanstack/react-query';
8
10
  import { SurfaceProvider } from '@oxy.so/bloom/surfaces';
9
11
  import { ToastOutlet } from '@oxy.so/bloom/toast';
@@ -105,7 +107,20 @@ const OxyProvider: FC<OxyProviderProps> = ({
105
107
  backgroundSession = false,
106
108
  language,
107
109
  campaignAttribution = false,
110
+ authStateStore,
108
111
  }) => {
112
+ // A platform that holds the Oxy session (ADR 0058) registers its host before
113
+ // the app's code runs. Read once, like `baseURL`: a host registered later
114
+ // does not re-bind a mounted provider. `'identity'` is never hosted.
115
+ const [sessionHost] = useState(() => (sessionMode === 'account' ? getOxySessionHost() : null));
116
+ useEffect(() => {
117
+ if (__DEV__ && sessionHost && authStateStore) {
118
+ loggerUtil.warn(
119
+ 'OxyProvider: authStateStore is ignored — a platform holds the session here (session host)',
120
+ { component: 'OxyProvider' },
121
+ );
122
+ }
123
+ }, [sessionHost, authStateStore]);
109
124
  const support = useMemo(
110
125
  () => ({ onAskAlia, documentationUrl, aliaAvatar, oxyOneArtwork }),
111
126
  [onAskAlia, documentationUrl, aliaAvatar, oxyOneArtwork],
@@ -253,42 +268,70 @@ const OxyProvider: FC<OxyProviderProps> = ({
253
268
  // duplicate scope that silently shadows the consumer's configuration.
254
269
  // It DOES set Bloom's locale (`BloomLocaleBridge`) to Oxy's language, but
255
270
  // defers to a locale the app already set above it.
271
+ const providerChildren = (
272
+ <>
273
+ <SupervisionStateObserver />
274
+ {productAnalytics ? <ProductAnalyticsObserver analytics={productAnalytics} /> : null}
275
+ <AccountLanguageBoundary language={language}>
276
+ <BloomLocaleBridge>
277
+ <OxySupportContext.Provider value={support}>
278
+ <SurfaceProvider>
279
+ {requireAuth === 'off' ? (
280
+ children
281
+ ) : (
282
+ <RequireOxyAuth prompt={requireAuth}>{children}</RequireOxyAuth>
283
+ )}
284
+ </SurfaceProvider>
285
+ </OxySupportContext.Provider>
286
+ <ToastOutlet />
287
+ </BloomLocaleBridge>
288
+ </AccountLanguageBoundary>
289
+ </>
290
+ );
291
+
256
292
  const coreContent = (
257
293
  <QueryClientProvider client={queryClient}>
258
- <OxyRuntimeProvider
259
- oxyServices={oxyServices as OxyRuntimeProviderProps['oxyServices']}
260
- baseURL={baseURL}
261
- authWebUrl={authWebUrl}
262
- authRedirectUri={authRedirectUri}
263
- authorizeBaseUrl={authorizeBaseUrl}
264
- storageKeyPrefix={storageKeyPrefix}
265
- clientId={clientId}
266
- sessionMode={sessionMode}
267
- webAuthMode={webAuthMode}
268
- backgroundSession={backgroundSession}
269
- legacyLanguageKeys={language?.legacyStorageKeys}
270
- captureCampaignAttribution={campaignAttribution}
271
- platformStorage={platformStorage}
272
- accountQueries={accountQueries}
273
- onAuthStateChange={onAuthStateChange as OxyRuntimeProviderProps['onAuthStateChange']}
274
- >
275
- <SupervisionStateObserver />
276
- {productAnalytics ? <ProductAnalyticsObserver analytics={productAnalytics} /> : null}
277
- <AccountLanguageBoundary language={language}>
278
- <BloomLocaleBridge>
279
- <OxySupportContext.Provider value={support}>
280
- <SurfaceProvider>
281
- {requireAuth === 'off' ? (
282
- children
283
- ) : (
284
- <RequireOxyAuth prompt={requireAuth}>{children}</RequireOxyAuth>
285
- )}
286
- </SurfaceProvider>
287
- </OxySupportContext.Provider>
288
- <ToastOutlet />
289
- </BloomLocaleBridge>
290
- </AccountLanguageBoundary>
291
- </OxyRuntimeProvider>
294
+ {sessionHost ? (
295
+ <OxyHostedRuntimeProvider
296
+ session={sessionHost}
297
+ oxyServices={oxyServices as OxyRuntimeProviderProps['oxyServices']}
298
+ baseURL={baseURL}
299
+ authWebUrl={authWebUrl}
300
+ authRedirectUri={authRedirectUri}
301
+ authorizeBaseUrl={authorizeBaseUrl}
302
+ storageKeyPrefix={storageKeyPrefix}
303
+ clientId={clientId}
304
+ webAuthMode={webAuthMode}
305
+ legacyLanguageKeys={language?.legacyStorageKeys}
306
+ captureCampaignAttribution={campaignAttribution}
307
+ platformStorage={platformStorage}
308
+ accountQueries={accountQueries}
309
+ onAuthStateChange={onAuthStateChange as OxyRuntimeProviderProps['onAuthStateChange']}
310
+ >
311
+ {providerChildren}
312
+ </OxyHostedRuntimeProvider>
313
+ ) : (
314
+ <OxyRuntimeProvider
315
+ oxyServices={oxyServices as OxyRuntimeProviderProps['oxyServices']}
316
+ baseURL={baseURL}
317
+ authWebUrl={authWebUrl}
318
+ authRedirectUri={authRedirectUri}
319
+ authorizeBaseUrl={authorizeBaseUrl}
320
+ storageKeyPrefix={storageKeyPrefix}
321
+ clientId={clientId}
322
+ sessionMode={sessionMode}
323
+ webAuthMode={webAuthMode}
324
+ backgroundSession={backgroundSession}
325
+ legacyLanguageKeys={language?.legacyStorageKeys}
326
+ captureCampaignAttribution={campaignAttribution}
327
+ platformStorage={platformStorage}
328
+ accountQueries={accountQueries}
329
+ authStateStore={authStateStore}
330
+ onAuthStateChange={onAuthStateChange as OxyRuntimeProviderProps['onAuthStateChange']}
331
+ >
332
+ {providerChildren}
333
+ </OxyRuntimeProvider>
334
+ )}
292
335
  </QueryClientProvider>
293
336
  );
294
337
 
@@ -168,6 +168,7 @@ export const OxyRuntimeProvider: React.FC<OxyRuntimeProviderProps> = ({
168
168
  captureCampaignAttribution = false,
169
169
  platformStorage,
170
170
  accountQueries,
171
+ authStateStore: providedAuthStateStore,
171
172
  onAuthStateChange,
172
173
  onError,
173
174
  }) => {
@@ -200,11 +201,19 @@ export const OxyRuntimeProvider: React.FC<OxyRuntimeProviderProps> = ({
200
201
  // web; SecureStore session blob on native). Built ONCE per provider mount.
201
202
  // Tracked, so a sign-in press can tell SYNCHRONOUSLY whether this origin
202
203
  // holds a device credential (the browser bridge must open inside the press).
204
+ //
205
+ // A platform's setup client passes its own (`authStateStore`): then it is the
206
+ // ONLY place a credential is written — the shared device slot and the
207
+ // background credential below are off, so nothing reaches platform storage.
203
208
  const authStoreRef = useRef<CredentialTrackingAuthStateStore | null>(null);
209
+ const ownsCredentialStorageRef = useRef(providedAuthStateStore === undefined);
204
210
  if (!authStoreRef.current) {
205
- authStoreRef.current = trackDeviceCredential(createPlatformAuthStateStore({ sessionMode }));
211
+ authStoreRef.current = trackDeviceCredential(
212
+ providedAuthStateStore ?? createPlatformAuthStateStore({ sessionMode }),
213
+ );
206
214
  }
207
215
  const authStore: AuthStateStore = authStoreRef.current;
216
+ const usesSharedDeviceCredential = ownsCredentialStorageRef.current;
208
217
 
209
218
  // Identity-bound session binding (`sessionMode: 'identity'`) — the platform pin
210
219
  // store plus the memoised pinned account id every lane below binds to. Built
@@ -791,7 +800,9 @@ export const OxyRuntimeProvider: React.FC<OxyRuntimeProviderProps> = ({
791
800
  ...(!identity && !isWebBrowser()
792
801
  ? {
793
802
  allowCommonsIdentityFallback: false,
794
- sharedDeviceCredential: createPlatformSharedDeviceCredentialStore() ?? undefined,
803
+ sharedDeviceCredential: usesSharedDeviceCredential
804
+ ? (createPlatformSharedDeviceCredentialStore() ?? undefined)
805
+ : undefined,
795
806
  }
796
807
  : {}),
797
808
  });
@@ -806,7 +817,7 @@ export const OxyRuntimeProvider: React.FC<OxyRuntimeProviderProps> = ({
806
817
  scheduler.dispose();
807
818
  oxyServices.http.setAuthRefreshHandler(null);
808
819
  };
809
- }, [oxyServices, authStore, identity, runtime]);
820
+ }, [oxyServices, authStore, identity, runtime, usesSharedDeviceCredential]);
810
821
 
811
822
  // ── Session commit funnel ────────────────────────────────────────────────
812
823
  // The single place a session becomes committed: plant tokens, persist the
@@ -1473,6 +1484,7 @@ export const OxyRuntimeProvider: React.FC<OxyRuntimeProviderProps> = ({
1473
1484
  authRedirectUri,
1474
1485
  sessionMode,
1475
1486
  identity: identity?.binding,
1487
+ useSharedDeviceCredential: usesSharedDeviceCredential,
1476
1488
  resolveSessionLane: resolveRegisteredLane,
1477
1489
  beforeDeviceBoot: identity
1478
1490
  ? async () => {
@@ -1504,6 +1516,7 @@ export const OxyRuntimeProvider: React.FC<OxyRuntimeProviderProps> = ({
1504
1516
  authRedirectUri,
1505
1517
  sessionMode,
1506
1518
  identity,
1519
+ usesSharedDeviceCredential,
1507
1520
  syncDeviceCredentialToHost,
1508
1521
  sessionClient,
1509
1522
  setTokenReady,
@@ -1760,7 +1773,9 @@ export const OxyRuntimeProvider: React.FC<OxyRuntimeProviderProps> = ({
1760
1773
  // needs a bearer, and keyed on the signed-in account so a sign-out or an
1761
1774
  // account switch revokes the credential before anything else happens.
1762
1775
  useBackgroundSessionSync({
1763
- enabled: backgroundSession,
1776
+ // A platform's own store (`authStateStore`) means no credential of ours
1777
+ // anywhere else, the background one included.
1778
+ enabled: backgroundSession && usesSharedDeviceCredential,
1764
1779
  oxyServices,
1765
1780
  userId: user?.id ?? null,
1766
1781
  canUsePrivateApi,