@oxyhq/services 5.7.5 → 5.8.2

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 (303) hide show
  1. package/README.md +76 -76
  2. package/lib/commonjs/core/index.js +177 -102
  3. package/lib/commonjs/core/index.js.map +1 -1
  4. package/lib/commonjs/index.js +69 -28
  5. package/lib/commonjs/index.js.map +1 -1
  6. package/lib/commonjs/ui/components/Avatar.js +15 -6
  7. package/lib/commonjs/ui/components/Avatar.js.map +1 -1
  8. package/lib/commonjs/ui/components/FollowButton.js +100 -12
  9. package/lib/commonjs/ui/components/FollowButton.js.map +1 -1
  10. package/lib/commonjs/ui/components/GroupedItem.js +58 -13
  11. package/lib/commonjs/ui/components/GroupedItem.js.map +1 -1
  12. package/lib/commonjs/ui/components/GroupedSection.js +7 -1
  13. package/lib/commonjs/ui/components/GroupedSection.js.map +1 -1
  14. package/lib/commonjs/ui/components/Header.js +356 -0
  15. package/lib/commonjs/ui/components/Header.js.map +1 -0
  16. package/lib/commonjs/ui/components/OxyProvider.js +28 -7
  17. package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
  18. package/lib/commonjs/ui/components/index.js +7 -0
  19. package/lib/commonjs/ui/components/index.js.map +1 -1
  20. package/lib/commonjs/ui/components/internal/GroupedPillButtons.js +1 -1
  21. package/lib/commonjs/ui/components/internal/GroupedPillButtons.js.map +1 -1
  22. package/lib/commonjs/ui/components/internal/TextField.js +606 -546
  23. package/lib/commonjs/ui/components/internal/TextField.js.map +1 -1
  24. package/lib/commonjs/ui/components/internal/TextField.md +436 -0
  25. package/lib/commonjs/ui/context/OxyContext.js +181 -199
  26. package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
  27. package/lib/commonjs/ui/hooks/index.js +6 -0
  28. package/lib/commonjs/ui/hooks/index.js.map +1 -1
  29. package/lib/commonjs/ui/hooks/useFollow.js +59 -2
  30. package/lib/commonjs/ui/hooks/useFollow.js.map +1 -1
  31. package/lib/commonjs/ui/hooks/useSessionSocket.js +5 -2
  32. package/lib/commonjs/ui/hooks/useSessionSocket.js.map +1 -1
  33. package/lib/commonjs/ui/navigation/OxyRouter.js +11 -1
  34. package/lib/commonjs/ui/navigation/OxyRouter.js.map +1 -1
  35. package/lib/commonjs/ui/screens/AccountCenterScreen.js +6 -6
  36. package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -1
  37. package/lib/commonjs/ui/screens/AccountManagementDemo.js +3 -3
  38. package/lib/commonjs/ui/screens/AccountManagementDemo.js.map +1 -1
  39. package/lib/commonjs/ui/screens/AccountOverviewScreen.js +241 -598
  40. package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -1
  41. package/lib/commonjs/ui/screens/AccountSettingsScreen.js +1160 -406
  42. package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
  43. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +135 -237
  44. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +1 -1
  45. package/lib/commonjs/ui/screens/AppInfoScreen.js +246 -463
  46. package/lib/commonjs/ui/screens/AppInfoScreen.js.map +1 -1
  47. package/lib/commonjs/ui/screens/FeedbackScreen.js +3 -3
  48. package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
  49. package/lib/commonjs/ui/screens/PaymentGatewayScreen.js +808 -650
  50. package/lib/commonjs/ui/screens/PaymentGatewayScreen.js.map +1 -1
  51. package/lib/commonjs/ui/screens/ProfileScreen.js +214 -37
  52. package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
  53. package/lib/commonjs/ui/screens/RecoverAccountScreen.js +51 -72
  54. package/lib/commonjs/ui/screens/RecoverAccountScreen.js.map +1 -1
  55. package/lib/commonjs/ui/screens/SessionManagementScreen.js +11 -29
  56. package/lib/commonjs/ui/screens/SessionManagementScreen.js.map +1 -1
  57. package/lib/commonjs/ui/screens/SignInScreen.js +30 -303
  58. package/lib/commonjs/ui/screens/SignInScreen.js.map +1 -1
  59. package/lib/commonjs/ui/screens/SignUpScreen.js +4 -4
  60. package/lib/commonjs/ui/screens/SignUpScreen.js.map +1 -1
  61. package/lib/commonjs/ui/screens/UserLinksScreen.js +90 -0
  62. package/lib/commonjs/ui/screens/UserLinksScreen.js.map +1 -0
  63. package/lib/commonjs/ui/screens/internal/SignInPasswordStep.js +19 -31
  64. package/lib/commonjs/ui/screens/internal/SignInPasswordStep.js.map +1 -1
  65. package/lib/commonjs/ui/screens/internal/SignInUsernameStep.js +7 -10
  66. package/lib/commonjs/ui/screens/internal/SignInUsernameStep.js.map +1 -1
  67. package/lib/commonjs/ui/screens/internal/SignUpIdentityStep.js +11 -5
  68. package/lib/commonjs/ui/screens/internal/SignUpIdentityStep.js.map +1 -1
  69. package/lib/commonjs/ui/screens/internal/SignUpSecurityStep.js +11 -4
  70. package/lib/commonjs/ui/screens/internal/SignUpSecurityStep.js.map +1 -1
  71. package/lib/commonjs/ui/screens/karma/KarmaAboutScreen.js +9 -6
  72. package/lib/commonjs/ui/screens/karma/KarmaAboutScreen.js.map +1 -1
  73. package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js +3 -30
  74. package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
  75. package/lib/commonjs/ui/screens/karma/KarmaFAQScreen.js +37 -46
  76. package/lib/commonjs/ui/screens/karma/KarmaFAQScreen.js.map +1 -1
  77. package/lib/commonjs/ui/screens/karma/KarmaLeaderboardScreen.js +9 -12
  78. package/lib/commonjs/ui/screens/karma/KarmaLeaderboardScreen.js.map +1 -1
  79. package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js +9 -12
  80. package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
  81. package/lib/commonjs/ui/screens/karma/KarmaRulesScreen.js +9 -12
  82. package/lib/commonjs/ui/screens/karma/KarmaRulesScreen.js.map +1 -1
  83. package/lib/commonjs/ui/stores/authStore.js +36 -6
  84. package/lib/commonjs/ui/stores/authStore.js.map +1 -1
  85. package/lib/commonjs/ui/stores/followStore.js +106 -1
  86. package/lib/commonjs/ui/stores/followStore.js.map +1 -1
  87. package/lib/commonjs/ui/styles/authStyles.js +337 -0
  88. package/lib/commonjs/ui/styles/authStyles.js.map +1 -0
  89. package/lib/commonjs/ui/styles/index.js +11 -0
  90. package/lib/commonjs/ui/styles/index.js.map +1 -1
  91. package/lib/module/core/index.js +177 -41
  92. package/lib/module/core/index.js.map +1 -1
  93. package/lib/module/index.js +24 -4
  94. package/lib/module/index.js.map +1 -1
  95. package/lib/module/ui/components/Avatar.js +15 -6
  96. package/lib/module/ui/components/Avatar.js.map +1 -1
  97. package/lib/module/ui/components/FollowButton.js +101 -13
  98. package/lib/module/ui/components/FollowButton.js.map +1 -1
  99. package/lib/module/ui/components/GroupedItem.js +59 -14
  100. package/lib/module/ui/components/GroupedItem.js.map +1 -1
  101. package/lib/module/ui/components/GroupedSection.js +7 -1
  102. package/lib/module/ui/components/GroupedSection.js.map +1 -1
  103. package/lib/module/ui/components/Header.js +351 -0
  104. package/lib/module/ui/components/Header.js.map +1 -0
  105. package/lib/module/ui/components/OxyProvider.js +30 -9
  106. package/lib/module/ui/components/OxyProvider.js.map +1 -1
  107. package/lib/module/ui/components/index.js +1 -0
  108. package/lib/module/ui/components/index.js.map +1 -1
  109. package/lib/module/ui/components/internal/GroupedPillButtons.js +1 -1
  110. package/lib/module/ui/components/internal/GroupedPillButtons.js.map +1 -1
  111. package/lib/module/ui/components/internal/TextField.js +607 -547
  112. package/lib/module/ui/components/internal/TextField.js.map +1 -1
  113. package/lib/module/ui/components/internal/TextField.md +436 -0
  114. package/lib/module/ui/context/OxyContext.js +180 -198
  115. package/lib/module/ui/context/OxyContext.js.map +1 -1
  116. package/lib/module/ui/hooks/index.js +1 -1
  117. package/lib/module/ui/hooks/index.js.map +1 -1
  118. package/lib/module/ui/hooks/useFollow.js +57 -1
  119. package/lib/module/ui/hooks/useFollow.js.map +1 -1
  120. package/lib/module/ui/hooks/useSessionSocket.js +5 -2
  121. package/lib/module/ui/hooks/useSessionSocket.js.map +1 -1
  122. package/lib/module/ui/navigation/OxyRouter.js +11 -1
  123. package/lib/module/ui/navigation/OxyRouter.js.map +1 -1
  124. package/lib/module/ui/screens/AccountCenterScreen.js +6 -6
  125. package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -1
  126. package/lib/module/ui/screens/AccountManagementDemo.js +3 -3
  127. package/lib/module/ui/screens/AccountManagementDemo.js.map +1 -1
  128. package/lib/module/ui/screens/AccountOverviewScreen.js +242 -597
  129. package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
  130. package/lib/module/ui/screens/AccountSettingsScreen.js +1161 -407
  131. package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
  132. package/lib/module/ui/screens/AccountSwitcherScreen.js +135 -237
  133. package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -1
  134. package/lib/module/ui/screens/AppInfoScreen.js +248 -465
  135. package/lib/module/ui/screens/AppInfoScreen.js.map +1 -1
  136. package/lib/module/ui/screens/FeedbackScreen.js +3 -3
  137. package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
  138. package/lib/module/ui/screens/PaymentGatewayScreen.js +809 -651
  139. package/lib/module/ui/screens/PaymentGatewayScreen.js.map +1 -1
  140. package/lib/module/ui/screens/ProfileScreen.js +214 -37
  141. package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
  142. package/lib/module/ui/screens/RecoverAccountScreen.js +53 -74
  143. package/lib/module/ui/screens/RecoverAccountScreen.js.map +1 -1
  144. package/lib/module/ui/screens/SessionManagementScreen.js +11 -29
  145. package/lib/module/ui/screens/SessionManagementScreen.js.map +1 -1
  146. package/lib/module/ui/screens/SignInScreen.js +32 -305
  147. package/lib/module/ui/screens/SignInScreen.js.map +1 -1
  148. package/lib/module/ui/screens/SignUpScreen.js +5 -5
  149. package/lib/module/ui/screens/SignUpScreen.js.map +1 -1
  150. package/lib/module/ui/screens/UserLinksScreen.js +85 -0
  151. package/lib/module/ui/screens/UserLinksScreen.js.map +1 -0
  152. package/lib/module/ui/screens/internal/SignInPasswordStep.js +19 -31
  153. package/lib/module/ui/screens/internal/SignInPasswordStep.js.map +1 -1
  154. package/lib/module/ui/screens/internal/SignInUsernameStep.js +7 -10
  155. package/lib/module/ui/screens/internal/SignInUsernameStep.js.map +1 -1
  156. package/lib/module/ui/screens/internal/SignUpIdentityStep.js +11 -5
  157. package/lib/module/ui/screens/internal/SignUpIdentityStep.js.map +1 -1
  158. package/lib/module/ui/screens/internal/SignUpSecurityStep.js +11 -4
  159. package/lib/module/ui/screens/internal/SignUpSecurityStep.js.map +1 -1
  160. package/lib/module/ui/screens/karma/KarmaAboutScreen.js +9 -6
  161. package/lib/module/ui/screens/karma/KarmaAboutScreen.js.map +1 -1
  162. package/lib/module/ui/screens/karma/KarmaCenterScreen.js +3 -30
  163. package/lib/module/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
  164. package/lib/module/ui/screens/karma/KarmaFAQScreen.js +37 -46
  165. package/lib/module/ui/screens/karma/KarmaFAQScreen.js.map +1 -1
  166. package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js +9 -12
  167. package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js.map +1 -1
  168. package/lib/module/ui/screens/karma/KarmaRewardsScreen.js +9 -12
  169. package/lib/module/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
  170. package/lib/module/ui/screens/karma/KarmaRulesScreen.js +9 -12
  171. package/lib/module/ui/screens/karma/KarmaRulesScreen.js.map +1 -1
  172. package/lib/module/ui/stores/authStore.js +36 -6
  173. package/lib/module/ui/stores/authStore.js.map +1 -1
  174. package/lib/module/ui/stores/followStore.js +106 -1
  175. package/lib/module/ui/stores/followStore.js.map +1 -1
  176. package/lib/module/ui/styles/authStyles.js +332 -0
  177. package/lib/module/ui/styles/authStyles.js.map +1 -0
  178. package/lib/module/ui/styles/index.js +1 -0
  179. package/lib/module/ui/styles/index.js.map +1 -1
  180. package/lib/typescript/core/index.d.ts +68 -24
  181. package/lib/typescript/core/index.d.ts.map +1 -1
  182. package/lib/typescript/index.d.ts +13 -3
  183. package/lib/typescript/index.d.ts.map +1 -1
  184. package/lib/typescript/ui/components/Avatar.d.ts.map +1 -1
  185. package/lib/typescript/ui/components/FollowButton.d.ts +1 -0
  186. package/lib/typescript/ui/components/FollowButton.d.ts.map +1 -1
  187. package/lib/typescript/ui/components/GroupedItem.d.ts +6 -0
  188. package/lib/typescript/ui/components/GroupedItem.d.ts.map +1 -1
  189. package/lib/typescript/ui/components/GroupedSection.d.ts +6 -0
  190. package/lib/typescript/ui/components/GroupedSection.d.ts.map +1 -1
  191. package/lib/typescript/ui/components/Header.d.ts +24 -0
  192. package/lib/typescript/ui/components/Header.d.ts.map +1 -0
  193. package/lib/typescript/ui/components/OxyProvider.d.ts.map +1 -1
  194. package/lib/typescript/ui/components/index.d.ts +1 -0
  195. package/lib/typescript/ui/components/index.d.ts.map +1 -1
  196. package/lib/typescript/ui/components/internal/TextField.d.ts +31 -16
  197. package/lib/typescript/ui/components/internal/TextField.d.ts.map +1 -1
  198. package/lib/typescript/ui/context/OxyContext.d.ts +5 -2
  199. package/lib/typescript/ui/context/OxyContext.d.ts.map +1 -1
  200. package/lib/typescript/ui/hooks/index.d.ts +1 -1
  201. package/lib/typescript/ui/hooks/index.d.ts.map +1 -1
  202. package/lib/typescript/ui/hooks/useFollow.d.ts +20 -0
  203. package/lib/typescript/ui/hooks/useFollow.d.ts.map +1 -1
  204. package/lib/typescript/ui/hooks/useSessionSocket.d.ts.map +1 -1
  205. package/lib/typescript/ui/navigation/OxyRouter.d.ts.map +1 -1
  206. package/lib/typescript/ui/navigation/types.d.ts +9 -2
  207. package/lib/typescript/ui/navigation/types.d.ts.map +1 -1
  208. package/lib/typescript/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
  209. package/lib/typescript/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
  210. package/lib/typescript/ui/screens/AccountSwitcherScreen.d.ts.map +1 -1
  211. package/lib/typescript/ui/screens/AppInfoScreen.d.ts.map +1 -1
  212. package/lib/typescript/ui/screens/PaymentGatewayScreen.d.ts.map +1 -1
  213. package/lib/typescript/ui/screens/ProfileScreen.d.ts.map +1 -1
  214. package/lib/typescript/ui/screens/RecoverAccountScreen.d.ts +5 -1
  215. package/lib/typescript/ui/screens/RecoverAccountScreen.d.ts.map +1 -1
  216. package/lib/typescript/ui/screens/SessionManagementScreen.d.ts.map +1 -1
  217. package/lib/typescript/ui/screens/SignInScreen.d.ts.map +1 -1
  218. package/lib/typescript/ui/screens/UserLinksScreen.d.ts +15 -0
  219. package/lib/typescript/ui/screens/UserLinksScreen.d.ts.map +1 -0
  220. package/lib/typescript/ui/screens/internal/SignInPasswordStep.d.ts +1 -1
  221. package/lib/typescript/ui/screens/internal/SignInPasswordStep.d.ts.map +1 -1
  222. package/lib/typescript/ui/screens/internal/SignInUsernameStep.d.ts +0 -1
  223. package/lib/typescript/ui/screens/internal/SignInUsernameStep.d.ts.map +1 -1
  224. package/lib/typescript/ui/screens/internal/SignUpIdentityStep.d.ts.map +1 -1
  225. package/lib/typescript/ui/screens/internal/SignUpSecurityStep.d.ts.map +1 -1
  226. package/lib/typescript/ui/screens/karma/KarmaAboutScreen.d.ts.map +1 -1
  227. package/lib/typescript/ui/screens/karma/KarmaCenterScreen.d.ts.map +1 -1
  228. package/lib/typescript/ui/screens/karma/KarmaFAQScreen.d.ts.map +1 -1
  229. package/lib/typescript/ui/screens/karma/KarmaLeaderboardScreen.d.ts.map +1 -1
  230. package/lib/typescript/ui/screens/karma/KarmaRewardsScreen.d.ts.map +1 -1
  231. package/lib/typescript/ui/screens/karma/KarmaRulesScreen.d.ts.map +1 -1
  232. package/lib/typescript/ui/stores/authStore.d.ts +3 -1
  233. package/lib/typescript/ui/stores/authStore.d.ts.map +1 -1
  234. package/lib/typescript/ui/stores/followStore.d.ts +10 -0
  235. package/lib/typescript/ui/stores/followStore.d.ts.map +1 -1
  236. package/lib/typescript/ui/styles/authStyles.d.ts +326 -0
  237. package/lib/typescript/ui/styles/authStyles.d.ts.map +1 -0
  238. package/lib/typescript/ui/styles/index.d.ts +1 -0
  239. package/lib/typescript/ui/styles/index.d.ts.map +1 -1
  240. package/package.json +1 -4
  241. package/src/core/index.ts +195 -41
  242. package/src/index.ts +64 -4
  243. package/src/ui/components/Avatar.tsx +11 -5
  244. package/src/ui/components/FollowButton.tsx +95 -11
  245. package/src/ui/components/GroupedItem.tsx +57 -9
  246. package/src/ui/components/GroupedSection.tsx +12 -0
  247. package/src/ui/components/Header.tsx +405 -0
  248. package/src/ui/components/OxyProvider.tsx +37 -15
  249. package/src/ui/components/index.ts +1 -0
  250. package/src/ui/components/internal/GroupedPillButtons.tsx +1 -1
  251. package/src/ui/components/internal/TextField.md +436 -0
  252. package/src/ui/components/internal/TextField.tsx +720 -620
  253. package/src/ui/context/OxyContext.tsx +211 -195
  254. package/src/ui/hooks/index.ts +1 -1
  255. package/src/ui/hooks/useFollow.ts +63 -0
  256. package/src/ui/hooks/useSessionSocket.ts +5 -2
  257. package/src/ui/navigation/OxyRouter.tsx +11 -1
  258. package/src/ui/navigation/types.ts +10 -2
  259. package/src/ui/screens/AccountCenterScreen.tsx +5 -5
  260. package/src/ui/screens/AccountManagementDemo.tsx +9 -9
  261. package/src/ui/screens/AccountOverviewScreen.tsx +265 -414
  262. package/src/ui/screens/AccountSettingsScreen.tsx +1173 -403
  263. package/src/ui/screens/AccountSwitcherScreen.tsx +158 -202
  264. package/src/ui/screens/AppInfoScreen.tsx +270 -497
  265. package/src/ui/screens/FeedbackScreen.tsx +3 -3
  266. package/src/ui/screens/PaymentGatewayScreen.tsx +668 -365
  267. package/src/ui/screens/ProfileScreen.tsx +196 -33
  268. package/src/ui/screens/RecoverAccountScreen.tsx +46 -74
  269. package/src/ui/screens/SessionManagementScreen.tsx +14 -22
  270. package/src/ui/screens/SignInScreen.tsx +27 -294
  271. package/src/ui/screens/SignUpScreen.tsx +5 -5
  272. package/src/ui/screens/UserLinksScreen.tsx +96 -0
  273. package/src/ui/screens/internal/SignInPasswordStep.tsx +11 -22
  274. package/src/ui/screens/internal/SignInUsernameStep.tsx +3 -10
  275. package/src/ui/screens/internal/SignUpIdentityStep.tsx +2 -5
  276. package/src/ui/screens/internal/SignUpSecurityStep.tsx +3 -4
  277. package/src/ui/screens/karma/KarmaAboutScreen.tsx +9 -2
  278. package/src/ui/screens/karma/KarmaCenterScreen.tsx +1 -20
  279. package/src/ui/screens/karma/KarmaFAQScreen.tsx +40 -24
  280. package/src/ui/screens/karma/KarmaLeaderboardScreen.tsx +9 -3
  281. package/src/ui/screens/karma/KarmaRewardsScreen.tsx +9 -3
  282. package/src/ui/screens/karma/KarmaRulesScreen.tsx +9 -3
  283. package/src/ui/stores/authStore.ts +34 -7
  284. package/src/ui/stores/followStore.ts +102 -1
  285. package/src/ui/styles/authStyles.ts +352 -0
  286. package/src/ui/styles/index.ts +1 -0
  287. package/lib/commonjs/core/auth-manager.js +0 -440
  288. package/lib/commonjs/core/auth-manager.js.map +0 -1
  289. package/lib/commonjs/core/use-auth.js +0 -244
  290. package/lib/commonjs/core/use-auth.js.map +0 -1
  291. package/lib/module/core/auth-manager.js +0 -432
  292. package/lib/module/core/auth-manager.js.map +0 -1
  293. package/lib/module/core/use-auth.js +0 -235
  294. package/lib/module/core/use-auth.js.map +0 -1
  295. package/lib/typescript/core/auth-manager.d.ts +0 -136
  296. package/lib/typescript/core/auth-manager.d.ts.map +0 -1
  297. package/lib/typescript/core/use-auth.d.ts +0 -79
  298. package/lib/typescript/core/use-auth.d.ts.map +0 -1
  299. package/src/__tests__/middleware.test.ts +0 -105
  300. package/src/__tests__/setup.ts +0 -10
  301. package/src/__tests__/zero-config-auth.test.ts +0 -607
  302. package/src/core/auth-manager.ts +0 -500
  303. package/src/core/use-auth.tsx +0 -245
@@ -3,8 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useOxy = exports.default = exports.OxyContextProvider = void 0;
6
+ exports.useOxy = exports.default = exports.OxyProvider = exports.OxyContextProvider = void 0;
7
7
  var _react = _interopRequireWildcard(require("react"));
8
+ var _core = require("../../core");
8
9
  var _deviceManager = require("../../utils/deviceManager");
9
10
  var _useSessionSocket = require("../hooks/useSessionSocket");
10
11
  var _sonner = require("../../lib/sonner");
@@ -61,17 +62,32 @@ const getStorage = async () => {
61
62
 
62
63
  // Storage keys for secure sessions
63
64
  const getSecureStorageKeys = (prefix = 'oxy_secure') => ({
64
- sessions: `${prefix}_sessions`,
65
- // Array of SecureClientSession objects
66
- activeSessionId: `${prefix}_active_session_id` // ID of currently active session
65
+ activeSessionId: `${prefix}_active_session_id` // Only store the active session ID
67
66
  });
68
- const OxyContextProvider = ({
67
+ const OxyProvider = ({
69
68
  children,
70
- oxyServices,
69
+ oxyServices: providedOxyServices,
70
+ baseURL,
71
71
  storageKeyPrefix = 'oxy_secure',
72
72
  onAuthStateChange,
73
+ onError,
73
74
  bottomSheetRef
74
75
  }) => {
76
+ // Create oxyServices automatically if not provided
77
+ const oxyServicesRef = (0, _react.useRef)(null);
78
+ if (!oxyServicesRef.current) {
79
+ if (providedOxyServices) {
80
+ oxyServicesRef.current = providedOxyServices;
81
+ } else if (baseURL) {
82
+ oxyServicesRef.current = new _core.OxyServices({
83
+ baseURL
84
+ });
85
+ } else {
86
+ throw new Error('Either oxyServices or baseURL must be provided to OxyContextProvider');
87
+ }
88
+ }
89
+ const oxyServices = oxyServicesRef.current;
90
+
75
91
  // Zustand state
76
92
  const user = (0, _authStore.useAuthStore)(state => state.user);
77
93
  const isAuthenticated = (0, _authStore.useAuthStore)(state => state.isAuthenticated);
@@ -108,7 +124,7 @@ const OxyContextProvider = ({
108
124
  initStorage();
109
125
  }, []);
110
126
 
111
- // Effect to initialize authentication state
127
+ // Effect to initialize authentication state - only store session ID
112
128
  (0, _react.useEffect)(() => {
113
129
  const initAuth = async () => {
114
130
  if (!storage) return;
@@ -116,79 +132,49 @@ const OxyContextProvider = ({
116
132
  isLoading: true
117
133
  });
118
134
  try {
119
- // Load stored sessions
120
- const sessionsData = await storage.getItem(keys.sessions);
135
+ // Only load the active session ID from storage
121
136
  const storedActiveSessionId = await storage.getItem(keys.activeSessionId);
122
- console.log('SecureAuth - sessionsData:', sessionsData);
123
137
  console.log('SecureAuth - activeSessionId:', storedActiveSessionId);
124
- if (sessionsData) {
125
- const parsedSessions = JSON.parse(sessionsData);
126
-
127
- // Migrate old session format to include user info
128
- const migratedSessions = [];
129
- let shouldUpdateStorage = false;
130
- for (const session of parsedSessions) {
131
- if (!session.userId) {
132
- // Session is missing user info, try to fetch it
133
- try {
134
- const sessionUser = await oxyServices.getUserBySession(session.sessionId);
135
- migratedSessions.push({
136
- ...session,
137
- userId: sessionUser.id
138
- });
139
- shouldUpdateStorage = true;
140
- console.log(`Migrated session ${session.sessionId} for user ${sessionUser.id}`);
141
- } catch (error) {
142
- // Session might be invalid, skip it
143
- console.log(`Removing invalid session ${session.sessionId}:`, error);
144
- shouldUpdateStorage = true;
138
+ if (storedActiveSessionId) {
139
+ // Validate the stored session with the backend
140
+ try {
141
+ const validation = await oxyServices.validateSession(storedActiveSessionId);
142
+ if (validation.valid) {
143
+ console.log('SecureAuth - session validated successfully');
144
+ setActiveSessionId(storedActiveSessionId);
145
+
146
+ // Get access token for API calls
147
+ await oxyServices.getTokenBySession(storedActiveSessionId);
148
+
149
+ // Load full user data from backend
150
+ const fullUser = await oxyServices.getUserBySession(storedActiveSessionId);
151
+ loginSuccess(fullUser);
152
+ setMinimalUser({
153
+ id: fullUser.id,
154
+ username: fullUser.username,
155
+ avatar: fullUser.avatar
156
+ });
157
+
158
+ // Load sessions from backend
159
+ const serverSessions = await oxyServices.getSessionsBySessionId(storedActiveSessionId);
160
+ const clientSessions = serverSessions.map(serverSession => ({
161
+ sessionId: serverSession.sessionId,
162
+ deviceId: serverSession.deviceId,
163
+ expiresAt: serverSession.expiresAt || new Date().toISOString(),
164
+ lastActive: serverSession.lastActive || new Date().toISOString(),
165
+ userId: serverSession.userId || fullUser.id
166
+ }));
167
+ setSessions(clientSessions);
168
+ if (onAuthStateChange) {
169
+ onAuthStateChange(fullUser);
145
170
  }
146
171
  } else {
147
- // Session already has user info
148
- migratedSessions.push(session);
149
- }
150
- }
151
-
152
- // Update storage if we made changes
153
- if (shouldUpdateStorage) {
154
- await saveSessionsToStorage(migratedSessions);
155
- }
156
- setSessions(migratedSessions);
157
- if (storedActiveSessionId && migratedSessions.length > 0) {
158
- const activeSession = migratedSessions.find(s => s.sessionId === storedActiveSessionId);
159
- if (activeSession) {
160
- console.log('SecureAuth - activeSession found:', activeSession);
161
-
162
- // Validate session
163
- try {
164
- const validation = await oxyServices.validateSession(activeSession.sessionId);
165
- if (validation.valid) {
166
- console.log('SecureAuth - session validated successfully');
167
- setActiveSessionId(activeSession.sessionId);
168
-
169
- // Get access token for API calls
170
- await oxyServices.getTokenBySession(activeSession.sessionId);
171
-
172
- // Load full user data
173
- const fullUser = await oxyServices.getUserBySession(activeSession.sessionId);
174
- loginSuccess(fullUser);
175
- setMinimalUser({
176
- id: fullUser.id,
177
- username: fullUser.username,
178
- avatar: fullUser.avatar
179
- });
180
- if (onAuthStateChange) {
181
- onAuthStateChange(fullUser);
182
- }
183
- } else {
184
- console.log('SecureAuth - session invalid, removing');
185
- await removeInvalidSession(activeSession.sessionId);
186
- }
187
- } catch (error) {
188
- console.error('SecureAuth - session validation error:', error);
189
- await removeInvalidSession(activeSession.sessionId);
190
- }
172
+ console.log('SecureAuth - session invalid, clearing storage');
173
+ await clearAllStorage();
191
174
  }
175
+ } catch (error) {
176
+ console.error('SecureAuth - session validation error:', error);
177
+ await clearAllStorage();
192
178
  }
193
179
  }
194
180
  } catch (err) {
@@ -203,33 +189,13 @@ const OxyContextProvider = ({
203
189
  if (storage) {
204
190
  initAuth();
205
191
  }
206
- }, [storage, oxyServices, keys, onAuthStateChange]);
207
-
208
- // Effect to restore token on app load or session switch
209
- (0, _react.useEffect)(() => {
210
- const restoreToken = async () => {
211
- if (activeSessionId && oxyServices) {
212
- try {
213
- await oxyServices.getTokenBySession(activeSessionId);
214
- setTokenReady(true);
215
- } catch (err) {
216
- // If token restoration fails, force logout
217
- await logout();
218
- setTokenReady(false);
219
- }
220
- } else {
221
- setTokenReady(true); // No session, so token is not needed
222
- }
223
- };
224
- restoreToken();
225
- // Only run when activeSessionId or oxyServices changes
226
- }, [activeSessionId, oxyServices]);
192
+ }, [storage, oxyServices, keys, onAuthStateChange, loginSuccess, setMinimalUser]);
227
193
 
228
- // Remove invalid session
194
+ // Remove invalid session - refresh sessions from backend
229
195
  const removeInvalidSession = (0, _react.useCallback)(async sessionId => {
196
+ // Remove from local state
230
197
  const filteredSessions = sessions.filter(s => s.sessionId !== sessionId);
231
198
  setSessions(filteredSessions);
232
- await saveSessionsToStorage(filteredSessions);
233
199
 
234
200
  // If there are other sessions, switch to the first one
235
201
  if (filteredSessions.length > 0) {
@@ -246,13 +212,7 @@ const OxyContextProvider = ({
246
212
  }
247
213
  }, [sessions, storage, keys, onAuthStateChange, logoutStore]);
248
214
 
249
- // Save sessions to storage
250
- const saveSessionsToStorage = (0, _react.useCallback)(async sessionsList => {
251
- if (!storage) return;
252
- await storage.setItem(keys.sessions, JSON.stringify(sessionsList));
253
- }, [storage, keys.sessions]);
254
-
255
- // Save active session ID to storage
215
+ // Save active session ID to storage (only session ID, no user data)
256
216
  const saveActiveSessionId = (0, _react.useCallback)(async sessionId => {
257
217
  if (!storage) return;
258
218
  await storage.setItem(keys.activeSessionId, sessionId);
@@ -262,7 +222,6 @@ const OxyContextProvider = ({
262
222
  const clearAllStorage = (0, _react.useCallback)(async () => {
263
223
  if (!storage) return;
264
224
  try {
265
- await storage.removeItem(keys.sessions);
266
225
  await storage.removeItem(keys.activeSessionId);
267
226
  } catch (err) {
268
227
  console.error('Clear secure storage error:', err);
@@ -304,8 +263,8 @@ const OxyContextProvider = ({
304
263
  }
305
264
  }, [oxyServices, onAuthStateChange, loginSuccess, saveActiveSessionId]);
306
265
 
307
- // Secure login method
308
- const login = async (username, password, deviceName) => {
266
+ // Secure login method - only store session ID, retrieve data from backend
267
+ const login = (0, _react.useCallback)(async (username, password, deviceName) => {
309
268
  if (!storage) throw new Error('Storage not initialized');
310
269
  _authStore.useAuthStore.setState({
311
270
  isLoading: true,
@@ -321,49 +280,28 @@ const OxyContextProvider = ({
321
280
  console.log('SecureAuth - Using device ID:', deviceInfo.deviceId);
322
281
  const response = await oxyServices.secureLogin(username, password, deviceName || deviceInfo.deviceName || _deviceManager.DeviceManager.getDefaultDeviceName(), deviceFingerprint);
323
282
 
324
- // Create client session object with user info for duplicate detection
325
- const clientSession = {
326
- sessionId: response.sessionId,
327
- deviceId: response.deviceId,
328
- expiresAt: response.expiresAt,
329
- lastActive: new Date().toISOString(),
330
- userId: response.user.id
331
- };
332
-
333
- // Check if this user already has a session (prevent duplicate accounts)
334
- const existingUserSessionIndex = sessions.findIndex(s => s.userId === response.user.id);
335
- let updatedSessions;
336
- if (existingUserSessionIndex !== -1) {
337
- // User already has a session - replace it with the new one (reused session scenario)
338
- const existingSession = sessions[existingUserSessionIndex];
339
- updatedSessions = [...sessions];
340
- updatedSessions[existingUserSessionIndex] = clientSession;
341
- console.log(`Reusing/updating existing session for user ${response.user.id}. Previous session: ${existingSession.sessionId}, New session: ${response.sessionId}`);
342
-
343
- // If the replaced session was the active one, update active session
344
- if (activeSessionId === existingSession.sessionId) {
345
- setActiveSessionId(response.sessionId);
346
- await saveActiveSessionId(response.sessionId);
347
- }
348
- } else {
349
- // Add new session for new user
350
- updatedSessions = [...sessions, clientSession];
351
- console.log(`Added new session for user ${response.user.id} on device ${response.deviceId}`);
352
- }
353
- setSessions(updatedSessions);
354
- await saveSessionsToStorage(updatedSessions);
355
-
356
- // Set as active session
283
+ // Set as active session (only store session ID)
357
284
  setActiveSessionId(response.sessionId);
358
285
  await saveActiveSessionId(response.sessionId);
359
286
 
360
287
  // Get access token for API calls
361
288
  await oxyServices.getTokenBySession(response.sessionId);
362
289
 
363
- // Load full user data
290
+ // Load full user data from backend
364
291
  const fullUser = await oxyServices.getUserBySession(response.sessionId);
365
292
  loginSuccess(fullUser);
366
293
  setMinimalUser(response.user);
294
+
295
+ // Load sessions from backend
296
+ const serverSessions = await oxyServices.getSessionsBySessionId(response.sessionId);
297
+ const clientSessions = serverSessions.map(serverSession => ({
298
+ sessionId: serverSession.sessionId,
299
+ deviceId: serverSession.deviceId,
300
+ expiresAt: serverSession.expiresAt || new Date().toISOString(),
301
+ lastActive: serverSession.lastActive || new Date().toISOString(),
302
+ userId: serverSession.userId || fullUser.id
303
+ }));
304
+ setSessions(clientSessions);
367
305
  if (onAuthStateChange) {
368
306
  onAuthStateChange(fullUser);
369
307
  }
@@ -376,19 +314,18 @@ const OxyContextProvider = ({
376
314
  isLoading: false
377
315
  });
378
316
  }
379
- };
317
+ }, [storage, oxyServices, saveActiveSessionId, loginSuccess, setMinimalUser, onAuthStateChange, loginFailure]);
380
318
 
381
319
  // Logout method
382
- const logout = async targetSessionId => {
320
+ const logout = (0, _react.useCallback)(async targetSessionId => {
383
321
  if (!activeSessionId) return;
384
322
  try {
385
323
  const sessionToLogout = targetSessionId || activeSessionId;
386
324
  await oxyServices.logoutSecureSession(activeSessionId, sessionToLogout);
387
325
 
388
- // Remove session from local storage
326
+ // Remove session from local state
389
327
  const filteredSessions = sessions.filter(s => s.sessionId !== sessionToLogout);
390
328
  setSessions(filteredSessions);
391
- await saveSessionsToStorage(filteredSessions);
392
329
 
393
330
  // If logging out active session
394
331
  if (sessionToLogout === activeSessionId) {
@@ -412,10 +349,10 @@ const OxyContextProvider = ({
412
349
  error: 'Logout failed'
413
350
  });
414
351
  }
415
- };
352
+ }, [activeSessionId, oxyServices, sessions, switchToSession, logoutStore, setMinimalUser, storage, keys.activeSessionId, onAuthStateChange]);
416
353
 
417
354
  // Logout all sessions
418
- const logoutAll = async () => {
355
+ const logoutAll = (0, _react.useCallback)(async () => {
419
356
  console.log('logoutAll called with activeSessionId:', activeSessionId);
420
357
  if (!activeSessionId) {
421
358
  console.error('No active session ID found, cannot logout all');
@@ -454,10 +391,30 @@ const OxyContextProvider = ({
454
391
  });
455
392
  throw error;
456
393
  }
457
- };
394
+ }, [activeSessionId, oxyServices, logoutStore, setMinimalUser, clearAllStorage, onAuthStateChange]);
395
+
396
+ // Effect to restore token on app load or session switch
397
+ (0, _react.useEffect)(() => {
398
+ const restoreToken = async () => {
399
+ if (activeSessionId && oxyServices) {
400
+ try {
401
+ await oxyServices.getTokenBySession(activeSessionId);
402
+ setTokenReady(true);
403
+ } catch (err) {
404
+ // If token restoration fails, force logout
405
+ await logout();
406
+ setTokenReady(false);
407
+ }
408
+ } else {
409
+ setTokenReady(true); // No session, so token is not needed
410
+ }
411
+ };
412
+ restoreToken();
413
+ // Only run when activeSessionId or oxyServices changes
414
+ }, [activeSessionId, oxyServices, logout]);
458
415
 
459
416
  // Sign up method
460
- const signUp = async (username, email, password) => {
417
+ const signUp = (0, _react.useCallback)(async (username, email, password) => {
461
418
  if (!storage) throw new Error('Storage not initialized');
462
419
  _authStore.useAuthStore.setState({
463
420
  isLoading: true,
@@ -480,41 +437,77 @@ const OxyContextProvider = ({
480
437
  isLoading: false
481
438
  });
482
439
  }
483
- };
440
+ }, [storage, oxyServices, login, loginFailure]);
484
441
 
485
442
  // Switch session method
486
- const switchSession = async sessionId => {
443
+ const switchSession = (0, _react.useCallback)(async sessionId => {
487
444
  await switchToSession(sessionId);
488
- };
445
+ }, [switchToSession]);
489
446
 
490
447
  // Remove session method
491
- const removeSession = async sessionId => {
448
+ const removeSession = (0, _react.useCallback)(async sessionId => {
492
449
  await logout(sessionId);
493
- };
450
+ }, [logout]);
494
451
 
495
452
  // Refresh sessions method
496
- const refreshSessions = async () => {
497
- if (!activeSessionId) return;
453
+ const refreshSessions = (0, _react.useCallback)(async () => {
454
+ console.log('refreshSessions called with activeSessionId:', activeSessionId);
455
+ if (!activeSessionId) {
456
+ console.log('refreshSessions: No activeSessionId, returning');
457
+ return;
458
+ }
498
459
  try {
460
+ console.log('refreshSessions: Calling getSessionsBySessionId...');
499
461
  const serverSessions = await oxyServices.getSessionsBySessionId(activeSessionId);
462
+ console.log('refreshSessions: Server sessions received:', serverSessions);
500
463
 
501
464
  // Update local sessions with server data
502
465
  const updatedSessions = serverSessions.map(serverSession => ({
503
466
  sessionId: serverSession.sessionId,
504
467
  deviceId: serverSession.deviceId,
505
- expiresAt: new Date().toISOString(),
506
- // You might want to get this from server
507
- lastActive: new Date().toISOString()
468
+ expiresAt: serverSession.expiresAt || new Date().toISOString(),
469
+ lastActive: serverSession.lastActive || new Date().toISOString(),
470
+ userId: serverSession.userId || user?.id
508
471
  }));
472
+ console.log('refreshSessions: Updated sessions:', updatedSessions);
509
473
  setSessions(updatedSessions);
510
- await saveSessionsToStorage(updatedSessions);
474
+ console.log('refreshSessions: Sessions updated in state');
511
475
  } catch (error) {
512
476
  console.error('Refresh sessions error:', error);
477
+
478
+ // If the current session is invalid, try to find another valid session
479
+ if (sessions.length > 1) {
480
+ console.log('Current session invalid, trying to switch to another session...');
481
+ const otherSessions = sessions.filter(s => s.sessionId !== activeSessionId);
482
+ for (const session of otherSessions) {
483
+ try {
484
+ // Try to validate this session
485
+ await oxyServices.validateSession(session.sessionId);
486
+ console.log('Found valid session, switching to:', session.sessionId);
487
+ await switchToSession(session.sessionId);
488
+ return; // Successfully switched to another session
489
+ } catch (sessionError) {
490
+ console.log('Session validation failed for:', session.sessionId, sessionError);
491
+ continue; // Try next session
492
+ }
493
+ }
494
+ }
495
+
496
+ // If no valid sessions found, clear all sessions
497
+ console.log('No valid sessions found, clearing all sessions');
498
+ setSessions([]);
499
+ setActiveSessionId(null);
500
+ logoutStore();
501
+ setMinimalUser(null);
502
+ await clearAllStorage();
503
+ if (onAuthStateChange) {
504
+ onAuthStateChange(null);
505
+ }
513
506
  }
514
- };
507
+ }, [activeSessionId, oxyServices, user?.id, sessions, switchToSession, logoutStore, setMinimalUser, clearAllStorage, onAuthStateChange]);
515
508
 
516
509
  // Device management methods
517
- const getDeviceSessions = async () => {
510
+ const getDeviceSessions = (0, _react.useCallback)(async () => {
518
511
  if (!activeSessionId) throw new Error('No active session');
519
512
  try {
520
513
  return await oxyServices.getDeviceSessions(activeSessionId);
@@ -522,8 +515,8 @@ const OxyContextProvider = ({
522
515
  console.error('Get device sessions error:', error);
523
516
  throw error;
524
517
  }
525
- };
526
- const logoutAllDeviceSessions = async () => {
518
+ }, [activeSessionId, oxyServices]);
519
+ const logoutAllDeviceSessions = (0, _react.useCallback)(async () => {
527
520
  if (!activeSessionId) throw new Error('No active session');
528
521
  try {
529
522
  await oxyServices.logoutAllDeviceSessions(activeSessionId);
@@ -541,8 +534,8 @@ const OxyContextProvider = ({
541
534
  console.error('Logout all device sessions error:', error);
542
535
  throw error;
543
536
  }
544
- };
545
- const updateDeviceName = async deviceName => {
537
+ }, [activeSessionId, oxyServices, logoutStore, setMinimalUser, clearAllStorage, onAuthStateChange]);
538
+ const updateDeviceName = (0, _react.useCallback)(async deviceName => {
546
539
  if (!activeSessionId) throw new Error('No active session');
547
540
  try {
548
541
  await oxyServices.updateDeviceName(activeSessionId, deviceName);
@@ -553,7 +546,7 @@ const OxyContextProvider = ({
553
546
  console.error('Update device name error:', error);
554
547
  throw error;
555
548
  }
556
- };
549
+ }, [activeSessionId, oxyServices]);
557
550
 
558
551
  // Bottom sheet control methods
559
552
  const showBottomSheet = (0, _react.useCallback)(screenOrConfig => {
@@ -570,6 +563,7 @@ const OxyContextProvider = ({
570
563
  bottomSheetRef.current.present();
571
564
  } else {
572
565
  console.warn('No expand or present method available on bottomSheetRef');
566
+ console.log('Available methods on bottomSheetRef.current:', Object.keys(bottomSheetRef.current));
573
567
  }
574
568
 
575
569
  // Then navigate to the specified screen if provided
@@ -589,6 +583,8 @@ const OxyContextProvider = ({
589
583
  }
590
584
  } else {
591
585
  console.warn('bottomSheetRef is not available');
586
+ console.warn('To fix this, ensure you pass a bottomSheetRef to OxyProvider:');
587
+ console.warn('<OxyProvider baseURL="..." bottomSheetRef={yourBottomSheetRef}>');
592
588
  }
593
589
  }, [bottomSheetRef]);
594
590
  const hideBottomSheet = (0, _react.useCallback)(() => {
@@ -603,16 +599,16 @@ const OxyContextProvider = ({
603
599
  userId: user?.id,
604
600
  activeSessionId,
605
601
  refreshSessions,
606
- logout: () => logout(),
602
+ logout,
607
603
  baseURL: oxyServices.getBaseURL(),
608
- onRemoteSignOut: () => {
604
+ onRemoteSignOut: (0, _react.useCallback)(() => {
609
605
  _sonner.toast.info('You have been signed out remotely.');
610
606
  logout();
611
- }
607
+ }, [logout])
612
608
  });
613
609
 
614
610
  // Context value
615
- const contextValue = {
611
+ const contextValue = (0, _react.useMemo)(() => ({
616
612
  user,
617
613
  minimalUser,
618
614
  sessions,
@@ -622,36 +618,19 @@ const OxyContextProvider = ({
622
618
  error,
623
619
  login,
624
620
  logout,
625
- logoutAll: async () => {
626
- await logout();
627
- },
628
- signUp: async (username, email, password) => {
629
- await signUp(username, email, password);
630
- return user; // Return the latest user from Zustand
631
- },
632
- switchSession: async sessionId => {
633
- await switchToSession(sessionId);
634
- },
635
- removeSession: async sessionId => {
636
- await removeSession(sessionId);
637
- },
638
- refreshSessions: async () => {
639
- await refreshSessions();
640
- },
641
- getDeviceSessions: async () => {
642
- return await getDeviceSessions();
643
- },
644
- logoutAllDeviceSessions: async () => {
645
- await logoutAllDeviceSessions();
646
- },
647
- updateDeviceName: async deviceName => {
648
- await updateDeviceName(deviceName);
649
- },
621
+ logoutAll,
622
+ signUp,
623
+ switchSession,
624
+ removeSession,
625
+ refreshSessions,
626
+ getDeviceSessions,
627
+ logoutAllDeviceSessions,
628
+ updateDeviceName,
650
629
  oxyServices,
651
630
  bottomSheetRef,
652
631
  showBottomSheet,
653
632
  hideBottomSheet
654
- };
633
+ }), [user, minimalUser, sessions, activeSessionId, isAuthenticated, isLoading, error, login, logout, logoutAll, signUp, switchSession, removeSession, refreshSessions, getDeviceSessions, logoutAllDeviceSessions, updateDeviceName, oxyServices, bottomSheetRef, showBottomSheet, hideBottomSheet]);
655
634
 
656
635
  // Wrap children rendering to block until token is ready
657
636
  if (!tokenReady) {
@@ -665,8 +644,11 @@ const OxyContextProvider = ({
665
644
  });
666
645
  };
667
646
 
647
+ // Alias for backward compatibility
648
+ exports.OxyProvider = OxyProvider;
649
+ const OxyContextProvider = exports.OxyContextProvider = OxyProvider;
650
+
668
651
  // Hook to use the context
669
- exports.OxyContextProvider = OxyContextProvider;
670
652
  const useOxy = () => {
671
653
  const context = (0, _react.useContext)(OxyContext);
672
654
  if (!context) {