@oxyhq/services 5.5.9 → 5.6.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.
- package/README.md +16 -2
- package/lib/commonjs/core/index.js +69 -82
- package/lib/commonjs/core/index.js.map +1 -1
- package/lib/commonjs/index.js +24 -183
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/node/index.js +0 -2
- package/lib/commonjs/node/index.js.map +1 -1
- package/lib/commonjs/ui/components/FollowButton.js +100 -229
- package/lib/commonjs/ui/components/FollowButton.js.map +1 -1
- package/lib/commonjs/ui/components/OxyPayButton.js +131 -0
- package/lib/commonjs/ui/components/OxyPayButton.js.map +1 -0
- package/lib/commonjs/ui/components/OxyProvider.js +41 -198
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/components/OxySignInButton.js +15 -2
- package/lib/commonjs/ui/components/OxySignInButton.js.map +1 -1
- package/lib/commonjs/ui/components/icon/FAIRWalletIcon.js +66 -0
- package/lib/commonjs/ui/components/icon/FAIRWalletIcon.js.map +1 -0
- package/lib/commonjs/ui/components/icon/index.js +7 -0
- package/lib/commonjs/ui/components/icon/index.js.map +1 -1
- package/lib/commonjs/ui/components/index.js +7 -0
- package/lib/commonjs/ui/components/index.js.map +1 -1
- package/lib/commonjs/ui/components/internal/GroupedPillButtons.js +14 -7
- package/lib/commonjs/ui/components/internal/GroupedPillButtons.js.map +1 -1
- package/lib/commonjs/ui/components/internal/PinInput.js +108 -0
- package/lib/commonjs/ui/components/internal/PinInput.js.map +1 -0
- package/lib/commonjs/ui/components/internal/TextField.js +20 -0
- package/lib/commonjs/ui/components/internal/TextField.js.map +1 -1
- package/lib/commonjs/ui/context/OxyContext.js +26 -36
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/hooks/index.js +2 -15
- package/lib/commonjs/ui/hooks/index.js.map +1 -1
- package/lib/commonjs/ui/hooks/useFollow.js +52 -136
- package/lib/commonjs/ui/hooks/useFollow.js.map +1 -1
- package/lib/commonjs/ui/hooks/useSessionSocket.js +52 -0
- package/lib/commonjs/ui/hooks/useSessionSocket.js.map +1 -0
- package/lib/commonjs/ui/index.js +8 -191
- package/lib/commonjs/ui/index.js.map +1 -1
- package/lib/commonjs/ui/navigation/OxyRouter.js +52 -60
- package/lib/commonjs/ui/navigation/OxyRouter.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountCenterScreen.js +18 -30
- package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js +4 -22
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js +6 -14
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +37 -66
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AppInfoScreen.js +21 -44
- package/lib/commonjs/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FeedbackScreen.js +44 -23
- package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FileManagementScreen.js +59 -78
- package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js +1588 -0
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +22 -36
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/RecoverAccountScreen.js +269 -0
- package/lib/commonjs/ui/screens/RecoverAccountScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/SessionManagementScreen.js +47 -69
- package/lib/commonjs/ui/screens/SessionManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SignInScreen.js +99 -333
- package/lib/commonjs/ui/screens/SignInScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SignUpScreen.js +136 -340
- package/lib/commonjs/ui/screens/SignUpScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/internal/SignInPasswordStep.js +192 -0
- package/lib/commonjs/ui/screens/internal/SignInPasswordStep.js.map +1 -0
- package/lib/commonjs/ui/screens/internal/SignInUsernameStep.js +135 -0
- package/lib/commonjs/ui/screens/internal/SignInUsernameStep.js.map +1 -0
- package/lib/commonjs/ui/screens/internal/SignUpIdentityStep.js +108 -0
- package/lib/commonjs/ui/screens/internal/SignUpIdentityStep.js.map +1 -0
- package/lib/commonjs/ui/screens/internal/SignUpSecurityStep.js +126 -0
- package/lib/commonjs/ui/screens/internal/SignUpSecurityStep.js.map +1 -0
- package/lib/commonjs/ui/screens/internal/SignUpSummaryStep.js +84 -0
- package/lib/commonjs/ui/screens/internal/SignUpSummaryStep.js.map +1 -0
- package/lib/commonjs/ui/screens/internal/SignUpWelcomeStep.js +59 -0
- package/lib/commonjs/ui/screens/internal/SignUpWelcomeStep.js.map +1 -0
- package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js +15 -2
- package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
- package/lib/commonjs/ui/stores/authStore.js +31 -0
- package/lib/commonjs/ui/stores/authStore.js.map +1 -0
- package/lib/commonjs/ui/stores/followStore.js +124 -0
- package/lib/commonjs/ui/stores/followStore.js.map +1 -0
- package/lib/commonjs/ui/styles/index.js +0 -11
- package/lib/commonjs/ui/styles/index.js.map +1 -1
- package/lib/commonjs/ui/utils/confirmAction.js +28 -0
- package/lib/commonjs/ui/utils/confirmAction.js.map +1 -0
- package/lib/module/core/index.js +69 -81
- package/lib/module/core/index.js.map +1 -1
- package/lib/module/index.js +14 -17
- package/lib/module/index.js.map +1 -1
- package/lib/module/node/index.js +0 -3
- package/lib/module/node/index.js.map +1 -1
- package/lib/module/ui/components/FollowButton.js +100 -229
- package/lib/module/ui/components/FollowButton.js.map +1 -1
- package/lib/module/ui/components/OxyPayButton.js +125 -0
- package/lib/module/ui/components/OxyPayButton.js.map +1 -0
- package/lib/module/ui/components/OxyProvider.js +42 -199
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/components/OxySignInButton.js +15 -2
- package/lib/module/ui/components/OxySignInButton.js.map +1 -1
- package/lib/module/ui/components/icon/FAIRWalletIcon.js +60 -0
- package/lib/module/ui/components/icon/FAIRWalletIcon.js.map +1 -0
- package/lib/module/ui/components/icon/index.js +1 -0
- package/lib/module/ui/components/icon/index.js.map +1 -1
- package/lib/module/ui/components/index.js +1 -0
- package/lib/module/ui/components/index.js.map +1 -1
- package/lib/module/ui/components/internal/GroupedPillButtons.js +15 -8
- package/lib/module/ui/components/internal/GroupedPillButtons.js.map +1 -1
- package/lib/module/ui/components/internal/PinInput.js +103 -0
- package/lib/module/ui/components/internal/PinInput.js.map +1 -0
- package/lib/module/ui/components/internal/TextField.js +20 -0
- package/lib/module/ui/components/internal/TextField.js.map +1 -1
- package/lib/module/ui/context/OxyContext.js +26 -36
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/hooks/index.js +1 -2
- package/lib/module/ui/hooks/index.js.map +1 -1
- package/lib/module/ui/hooks/useFollow.js +52 -137
- package/lib/module/ui/hooks/useFollow.js.map +1 -1
- package/lib/module/ui/hooks/useSessionSocket.js +47 -0
- package/lib/module/ui/hooks/useSessionSocket.js.map +1 -0
- package/lib/module/ui/index.js +2 -13
- package/lib/module/ui/index.js.map +1 -1
- package/lib/module/ui/navigation/OxyRouter.js +53 -61
- package/lib/module/ui/navigation/OxyRouter.js.map +1 -1
- package/lib/module/ui/screens/AccountCenterScreen.js +6 -18
- package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountOverviewScreen.js +5 -23
- package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSettingsScreen.js +7 -15
- package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSwitcherScreen.js +38 -67
- package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/module/ui/screens/AppInfoScreen.js +22 -45
- package/lib/module/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/module/ui/screens/FeedbackScreen.js +44 -23
- package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/module/ui/screens/FileManagementScreen.js +59 -78
- package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/PaymentGatewayScreen.js +1583 -0
- package/lib/module/ui/screens/PaymentGatewayScreen.js.map +1 -0
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js +23 -37
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/module/ui/screens/RecoverAccountScreen.js +263 -0
- package/lib/module/ui/screens/RecoverAccountScreen.js.map +1 -0
- package/lib/module/ui/screens/SessionManagementScreen.js +47 -69
- package/lib/module/ui/screens/SessionManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/SignInScreen.js +100 -334
- package/lib/module/ui/screens/SignInScreen.js.map +1 -1
- package/lib/module/ui/screens/SignUpScreen.js +137 -341
- package/lib/module/ui/screens/SignUpScreen.js.map +1 -1
- package/lib/module/ui/screens/internal/SignInPasswordStep.js +186 -0
- package/lib/module/ui/screens/internal/SignInPasswordStep.js.map +1 -0
- package/lib/module/ui/screens/internal/SignInUsernameStep.js +129 -0
- package/lib/module/ui/screens/internal/SignInUsernameStep.js.map +1 -0
- package/lib/module/ui/screens/internal/SignUpIdentityStep.js +102 -0
- package/lib/module/ui/screens/internal/SignUpIdentityStep.js.map +1 -0
- package/lib/module/ui/screens/internal/SignUpSecurityStep.js +120 -0
- package/lib/module/ui/screens/internal/SignUpSecurityStep.js.map +1 -0
- package/lib/module/ui/screens/internal/SignUpSummaryStep.js +79 -0
- package/lib/module/ui/screens/internal/SignUpSummaryStep.js.map +1 -0
- package/lib/module/ui/screens/internal/SignUpWelcomeStep.js +54 -0
- package/lib/module/ui/screens/internal/SignUpWelcomeStep.js.map +1 -0
- package/lib/module/ui/screens/karma/KarmaRewardsScreen.js +16 -3
- package/lib/module/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
- package/lib/module/ui/stores/authStore.js +27 -0
- package/lib/module/ui/stores/authStore.js.map +1 -0
- package/lib/module/ui/stores/followStore.js +120 -0
- package/lib/module/ui/stores/followStore.js.map +1 -0
- package/lib/module/ui/styles/index.js +0 -1
- package/lib/module/ui/styles/index.js.map +1 -1
- package/lib/module/ui/utils/confirmAction.js +25 -0
- package/lib/module/ui/utils/confirmAction.js.map +1 -0
- package/lib/typescript/core/index.d.ts +28 -10
- package/lib/typescript/core/index.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +5 -4
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/models/secureSession.d.ts +0 -1
- package/lib/typescript/models/secureSession.d.ts.map +1 -1
- package/lib/typescript/node/index.d.ts +0 -1
- package/lib/typescript/node/index.d.ts.map +1 -1
- package/lib/typescript/ui/components/FollowButton.d.ts +1 -77
- package/lib/typescript/ui/components/FollowButton.d.ts.map +1 -1
- package/lib/typescript/ui/components/OxyPayButton.d.ts +29 -0
- package/lib/typescript/ui/components/OxyPayButton.d.ts.map +1 -0
- package/lib/typescript/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/ui/components/OxySignInButton.d.ts.map +1 -1
- package/lib/typescript/ui/components/icon/FAIRWalletIcon.d.ts +8 -0
- package/lib/typescript/ui/components/icon/FAIRWalletIcon.d.ts.map +1 -0
- package/lib/typescript/ui/components/icon/index.d.ts +1 -0
- package/lib/typescript/ui/components/icon/index.d.ts.map +1 -1
- package/lib/typescript/ui/components/index.d.ts +1 -0
- package/lib/typescript/ui/components/index.d.ts.map +1 -1
- package/lib/typescript/ui/components/internal/GroupedPillButtons.d.ts.map +1 -1
- package/lib/typescript/ui/components/internal/PinInput.d.ts +12 -0
- package/lib/typescript/ui/components/internal/PinInput.d.ts.map +1 -0
- package/lib/typescript/ui/components/internal/TextField.d.ts +1 -0
- package/lib/typescript/ui/components/internal/TextField.d.ts.map +1 -1
- package/lib/typescript/ui/context/OxyContext.d.ts +0 -2
- package/lib/typescript/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/ui/hooks/index.d.ts +1 -2
- package/lib/typescript/ui/hooks/index.d.ts.map +1 -1
- package/lib/typescript/ui/hooks/useFollow.d.ts +14 -15
- package/lib/typescript/ui/hooks/useFollow.d.ts.map +1 -1
- package/lib/typescript/ui/hooks/useSessionSocket.d.ts +11 -0
- package/lib/typescript/ui/hooks/useSessionSocket.d.ts.map +1 -0
- package/lib/typescript/ui/index.d.ts +2 -5
- package/lib/typescript/ui/index.d.ts.map +1 -1
- package/lib/typescript/ui/navigation/OxyRouter.d.ts.map +1 -1
- package/lib/typescript/ui/navigation/types.d.ts +5 -23
- package/lib/typescript/ui/navigation/types.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountCenterScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountSwitcherScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AppInfoScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/FeedbackScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/FileManagementScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/PaymentGatewayScreen.d.ts +27 -0
- package/lib/typescript/ui/screens/PaymentGatewayScreen.d.ts.map +1 -0
- package/lib/typescript/ui/screens/PremiumSubscriptionScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/RecoverAccountScreen.d.ts +8 -0
- package/lib/typescript/ui/screens/RecoverAccountScreen.d.ts.map +1 -0
- package/lib/typescript/ui/screens/SessionManagementScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/SignInScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/SignUpScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/internal/SignInPasswordStep.d.ts +27 -0
- package/lib/typescript/ui/screens/internal/SignInPasswordStep.d.ts.map +1 -0
- package/lib/typescript/ui/screens/internal/SignInUsernameStep.d.ts +26 -0
- package/lib/typescript/ui/screens/internal/SignInUsernameStep.d.ts.map +1 -0
- package/lib/typescript/ui/screens/internal/SignUpIdentityStep.d.ts +20 -0
- package/lib/typescript/ui/screens/internal/SignUpIdentityStep.d.ts.map +1 -0
- package/lib/typescript/ui/screens/internal/SignUpSecurityStep.d.ts +24 -0
- package/lib/typescript/ui/screens/internal/SignUpSecurityStep.d.ts.map +1 -0
- package/lib/typescript/ui/screens/internal/SignUpSummaryStep.d.ts +15 -0
- package/lib/typescript/ui/screens/internal/SignUpSummaryStep.d.ts.map +1 -0
- package/lib/typescript/ui/screens/internal/SignUpWelcomeStep.d.ts +13 -0
- package/lib/typescript/ui/screens/internal/SignUpWelcomeStep.d.ts.map +1 -0
- package/lib/typescript/ui/screens/karma/KarmaRewardsScreen.d.ts.map +1 -1
- package/lib/typescript/ui/stores/authStore.d.ts +14 -0
- package/lib/typescript/ui/stores/authStore.d.ts.map +1 -0
- package/lib/typescript/ui/stores/followStore.d.ts +15 -0
- package/lib/typescript/ui/stores/followStore.d.ts.map +1 -0
- package/lib/typescript/ui/styles/index.d.ts +0 -1
- package/lib/typescript/ui/styles/index.d.ts.map +1 -1
- package/lib/typescript/ui/utils/confirmAction.d.ts +7 -0
- package/lib/typescript/ui/utils/confirmAction.d.ts.map +1 -0
- package/package.json +12 -7
- package/src/core/index.ts +78 -88
- package/src/index.ts +8 -45
- package/src/models/secureSession.ts +1 -2
- package/src/node/index.ts +0 -3
- package/src/ui/components/FollowButton.tsx +100 -322
- package/src/ui/components/OxyPayButton.tsx +133 -0
- package/src/ui/components/OxyProvider.tsx +39 -201
- package/src/ui/components/OxySignInButton.tsx +13 -2
- package/src/ui/components/icon/FAIRWalletIcon.tsx +49 -0
- package/src/ui/components/icon/index.ts +1 -0
- package/src/ui/components/index.ts +1 -0
- package/src/ui/components/internal/GroupedPillButtons.tsx +12 -8
- package/src/ui/components/internal/PinInput.tsx +102 -0
- package/src/ui/components/internal/TextField.tsx +9 -0
- package/src/ui/context/OxyContext.tsx +26 -40
- package/src/ui/hooks/index.ts +1 -2
- package/src/ui/hooks/useFollow.ts +58 -129
- package/src/ui/hooks/useSessionSocket.ts +50 -0
- package/src/ui/index.ts +2 -37
- package/src/ui/navigation/OxyRouter.tsx +47 -63
- package/src/ui/navigation/types.ts +5 -26
- package/src/ui/screens/AccountCenterScreen.tsx +12 -21
- package/src/ui/screens/AccountOverviewScreen.tsx +6 -30
- package/src/ui/screens/AccountSettingsScreen.tsx +7 -22
- package/src/ui/screens/AccountSwitcherScreen.tsx +46 -88
- package/src/ui/screens/AppInfoScreen.tsx +27 -47
- package/src/ui/screens/FeedbackScreen.tsx +34 -19
- package/src/ui/screens/FileManagementScreen.tsx +293 -321
- package/src/ui/screens/PaymentGatewayScreen.tsx +1315 -0
- package/src/ui/screens/PremiumSubscriptionScreen.tsx +109 -124
- package/src/ui/screens/RecoverAccountScreen.tsx +260 -0
- package/src/ui/screens/SessionManagementScreen.tsx +65 -137
- package/src/ui/screens/SignInScreen.tsx +89 -283
- package/src/ui/screens/SignUpScreen.tsx +138 -291
- package/src/ui/screens/internal/SignInPasswordStep.tsx +179 -0
- package/src/ui/screens/internal/SignInUsernameStep.tsx +139 -0
- package/src/ui/screens/internal/SignUpIdentityStep.tsx +114 -0
- package/src/ui/screens/internal/SignUpSecurityStep.tsx +132 -0
- package/src/ui/screens/internal/SignUpSummaryStep.tsx +66 -0
- package/src/ui/screens/internal/SignUpWelcomeStep.tsx +52 -0
- package/src/ui/screens/karma/KarmaRewardsScreen.tsx +13 -3
- package/src/ui/stores/authStore.ts +24 -0
- package/src/ui/stores/followStore.ts +80 -0
- package/src/ui/styles/index.ts +0 -1
- package/src/ui/utils/confirmAction.ts +23 -0
- package/lib/commonjs/ui/components/bottomSheet/index.js +0 -37
- package/lib/commonjs/ui/components/bottomSheet/index.js.map +0 -1
- package/lib/commonjs/ui/hooks/useAuthFetch.js +0 -217
- package/lib/commonjs/ui/hooks/useAuthFetch.js.map +0 -1
- package/lib/commonjs/ui/hooks/useOxyFollow.js +0 -190
- package/lib/commonjs/ui/hooks/useOxyFollow.js.map +0 -1
- package/lib/commonjs/ui/screens/BillingManagementScreen.js +0 -636
- package/lib/commonjs/ui/screens/BillingManagementScreen.js.map +0 -1
- package/lib/commonjs/ui/store/index.js +0 -67
- package/lib/commonjs/ui/store/index.js.map +0 -1
- package/lib/commonjs/ui/store/setupOxyStore.js +0 -63
- package/lib/commonjs/ui/store/setupOxyStore.js.map +0 -1
- package/lib/commonjs/ui/store/slices/authSlice.js +0 -56
- package/lib/commonjs/ui/store/slices/authSlice.js.map +0 -1
- package/lib/commonjs/ui/store/slices/followSlice.js +0 -238
- package/lib/commonjs/ui/store/slices/followSlice.js.map +0 -1
- package/lib/commonjs/ui/store/slices/index.js +0 -129
- package/lib/commonjs/ui/store/slices/index.js.map +0 -1
- package/lib/commonjs/ui/store/slices/types.js +0 -19
- package/lib/commonjs/ui/store/slices/types.js.map +0 -1
- package/lib/commonjs/ui/styles/shadows.js +0 -123
- package/lib/commonjs/ui/styles/shadows.js.map +0 -1
- package/lib/commonjs/utils/polyfills.js +0 -42
- package/lib/commonjs/utils/polyfills.js.map +0 -1
- package/lib/module/ui/components/bottomSheet/index.js +0 -5
- package/lib/module/ui/components/bottomSheet/index.js.map +0 -1
- package/lib/module/ui/hooks/useAuthFetch.js +0 -212
- package/lib/module/ui/hooks/useAuthFetch.js.map +0 -1
- package/lib/module/ui/hooks/useOxyFollow.js +0 -186
- package/lib/module/ui/hooks/useOxyFollow.js.map +0 -1
- package/lib/module/ui/screens/BillingManagementScreen.js +0 -631
- package/lib/module/ui/screens/BillingManagementScreen.js.map +0 -1
- package/lib/module/ui/store/index.js +0 -33
- package/lib/module/ui/store/index.js.map +0 -1
- package/lib/module/ui/store/setupOxyStore.js +0 -59
- package/lib/module/ui/store/setupOxyStore.js.map +0 -1
- package/lib/module/ui/store/slices/authSlice.js +0 -48
- package/lib/module/ui/store/slices/authSlice.js.map +0 -1
- package/lib/module/ui/store/slices/followSlice.js +0 -232
- package/lib/module/ui/store/slices/followSlice.js.map +0 -1
- package/lib/module/ui/store/slices/index.js +0 -11
- package/lib/module/ui/store/slices/index.js.map +0 -1
- package/lib/module/ui/store/slices/types.js +0 -15
- package/lib/module/ui/store/slices/types.js.map +0 -1
- package/lib/module/ui/styles/shadows.js +0 -119
- package/lib/module/ui/styles/shadows.js.map +0 -1
- package/lib/module/utils/polyfills.js +0 -36
- package/lib/module/utils/polyfills.js.map +0 -1
- package/lib/typescript/types/react-redux.d.ts +0 -5
- package/lib/typescript/ui/components/bottomSheet/index.d.ts +0 -4
- package/lib/typescript/ui/components/bottomSheet/index.d.ts.map +0 -1
- package/lib/typescript/ui/hooks/useAuthFetch.d.ts +0 -34
- package/lib/typescript/ui/hooks/useAuthFetch.d.ts.map +0 -1
- package/lib/typescript/ui/hooks/useOxyFollow.d.ts +0 -81
- package/lib/typescript/ui/hooks/useOxyFollow.d.ts.map +0 -1
- package/lib/typescript/ui/screens/BillingManagementScreen.d.ts +0 -5
- package/lib/typescript/ui/screens/BillingManagementScreen.d.ts.map +0 -1
- package/lib/typescript/ui/store/index.d.ts +0 -27
- package/lib/typescript/ui/store/index.d.ts.map +0 -1
- package/lib/typescript/ui/store/setupOxyStore.d.ts +0 -29
- package/lib/typescript/ui/store/setupOxyStore.d.ts.map +0 -1
- package/lib/typescript/ui/store/slices/authSlice.d.ts +0 -32
- package/lib/typescript/ui/store/slices/authSlice.d.ts.map +0 -1
- package/lib/typescript/ui/store/slices/followSlice.d.ts +0 -120
- package/lib/typescript/ui/store/slices/followSlice.d.ts.map +0 -1
- package/lib/typescript/ui/store/slices/index.d.ts +0 -9
- package/lib/typescript/ui/store/slices/index.d.ts.map +0 -1
- package/lib/typescript/ui/store/slices/types.d.ts +0 -16
- package/lib/typescript/ui/store/slices/types.d.ts.map +0 -1
- package/lib/typescript/ui/styles/shadows.d.ts +0 -233
- package/lib/typescript/ui/styles/shadows.d.ts.map +0 -1
- package/lib/typescript/utils/polyfills.d.ts +0 -6
- package/lib/typescript/utils/polyfills.d.ts.map +0 -1
- package/src/__tests__/backend-middleware.test.ts +0 -209
- package/src/__tests__/polyfills.test.ts +0 -30
- package/src/__tests__/setup.ts +0 -43
- package/src/__tests__/ui/hooks/authfetch-integration.test.ts +0 -197
- package/src/__tests__/ui/hooks/backward-compatibility.test.ts +0 -159
- package/src/__tests__/ui/hooks/real-world-scenarios.test.ts +0 -224
- package/src/__tests__/ui/hooks/url-resolution.test.ts +0 -129
- package/src/__tests__/ui/hooks/useAuthFetch-separation.test.ts +0 -69
- package/src/__tests__/ui/hooks/useAuthFetch.test.ts +0 -70
- package/src/__tests__/ui/hooks/useOxyFollow.test.tsx +0 -92
- package/src/__tests__/ui/screens/AccountSettingsScreen.test.tsx +0 -112
- package/src/__tests__/ui/store/setupOxyStore.test.ts +0 -50
- package/src/__tests__/validate-structure.js +0 -91
- package/src/__tests__/validation.js +0 -42
- package/src/types/react-redux.d.ts +0 -5
- package/src/ui/components/bottomSheet/index.tsx +0 -14
- package/src/ui/hooks/useAuthFetch.ts +0 -238
- package/src/ui/hooks/useOxyFollow.ts +0 -188
- package/src/ui/screens/BillingManagementScreen.tsx +0 -589
- package/src/ui/store/index.ts +0 -36
- package/src/ui/store/setupOxyStore.ts +0 -58
- package/src/ui/store/slices/authSlice.ts +0 -43
- package/src/ui/store/slices/followSlice.ts +0 -207
- package/src/ui/store/slices/index.ts +0 -31
- package/src/ui/store/slices/types.ts +0 -33
- package/src/ui/styles/shadows.ts +0 -112
- package/src/utils/polyfills.ts +0 -34
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import React, { useState, useRef, useCallback } from 'react';
|
|
2
|
+
import { View, Text, Animated, KeyboardAvoidingView, Platform, ScrollView, StyleSheet, StatusBar, TextInput } from 'react-native';
|
|
3
|
+
import { Ionicons } from '@expo/vector-icons';
|
|
4
|
+
import TextField from '../components/internal/TextField';
|
|
5
|
+
import GroupedPillButtons from '../components/internal/GroupedPillButtons';
|
|
6
|
+
import HighFive from '../../assets/illustrations/HighFive';
|
|
7
|
+
import { useThemeColors } from '../styles';
|
|
8
|
+
import PinInput from '../components/internal/PinInput';
|
|
9
|
+
|
|
10
|
+
interface RecoverAccountScreenProps {
|
|
11
|
+
navigate: (screen: string) => void;
|
|
12
|
+
theme: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const PIN_LENGTH = 6;
|
|
16
|
+
|
|
17
|
+
const RecoverAccountScreen: React.FC<RecoverAccountScreenProps> = ({ navigate, theme }) => {
|
|
18
|
+
const [identifier, setIdentifier] = useState('');
|
|
19
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
20
|
+
const [errorMessage, setErrorMessage] = useState('');
|
|
21
|
+
const [successMessage, setSuccessMessage] = useState('');
|
|
22
|
+
const [step, setStep] = useState<'request' | 'code' | 'done'>('request');
|
|
23
|
+
const [code, setCode] = useState('');
|
|
24
|
+
const fadeAnim = useRef(new Animated.Value(1)).current;
|
|
25
|
+
const slideAnim = useRef(new Animated.Value(0)).current;
|
|
26
|
+
const colors = useThemeColors(theme as 'light' | 'dark');
|
|
27
|
+
const styles = createStyles(colors);
|
|
28
|
+
const identifierRef = useRef<TextInput>(null);
|
|
29
|
+
const handleRequestWithFocus = () => {
|
|
30
|
+
if (!identifier) {
|
|
31
|
+
setTimeout(() => {
|
|
32
|
+
identifierRef.current?.focus();
|
|
33
|
+
}, 0);
|
|
34
|
+
}
|
|
35
|
+
handleRequest();
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const handleRequest = async () => {
|
|
39
|
+
setErrorMessage('');
|
|
40
|
+
setSuccessMessage('');
|
|
41
|
+
if (!identifier || identifier.length < 3) {
|
|
42
|
+
setErrorMessage('Please enter your email or username.');
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
setIsLoading(true);
|
|
46
|
+
setTimeout(() => {
|
|
47
|
+
setIsLoading(false);
|
|
48
|
+
setStep('code');
|
|
49
|
+
setSuccessMessage('A 6-digit code has been sent to your email or phone.');
|
|
50
|
+
}, 1200);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const handleVerifyCode = async () => {
|
|
54
|
+
setErrorMessage('');
|
|
55
|
+
setSuccessMessage('');
|
|
56
|
+
if (code.length !== PIN_LENGTH) {
|
|
57
|
+
setErrorMessage('Please enter the 6-digit code.');
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
setIsLoading(true);
|
|
61
|
+
setTimeout(() => {
|
|
62
|
+
setIsLoading(false);
|
|
63
|
+
if (code === '123456') { // Simulate correct code
|
|
64
|
+
setStep('done');
|
|
65
|
+
setSuccessMessage('Your account has been verified! You can now reset your password.');
|
|
66
|
+
} else {
|
|
67
|
+
setErrorMessage('Invalid code. Please try again.');
|
|
68
|
+
}
|
|
69
|
+
}, 1200);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
return (
|
|
73
|
+
<KeyboardAvoidingView
|
|
74
|
+
style={[styles.container, { backgroundColor: colors.background }]}
|
|
75
|
+
behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
|
|
76
|
+
>
|
|
77
|
+
<StatusBar
|
|
78
|
+
barStyle={theme === 'dark' ? 'light-content' : 'dark-content'}
|
|
79
|
+
backgroundColor={colors.background}
|
|
80
|
+
/>
|
|
81
|
+
<ScrollView
|
|
82
|
+
contentContainerStyle={styles.scrollContent}
|
|
83
|
+
showsVerticalScrollIndicator={false}
|
|
84
|
+
keyboardShouldPersistTaps="handled"
|
|
85
|
+
>
|
|
86
|
+
<Animated.View style={[
|
|
87
|
+
styles.stepContainer,
|
|
88
|
+
{ opacity: fadeAnim, transform: [{ translateX: slideAnim }] }
|
|
89
|
+
]}>
|
|
90
|
+
<HighFive width={100} height={100} />
|
|
91
|
+
<View style={styles.modernHeader}>
|
|
92
|
+
<Text style={[styles.modernTitle, { color: colors.text }]}>Recover Account</Text>
|
|
93
|
+
<Text style={[styles.modernSubtitle, { color: colors.secondaryText }]}>Enter your email or username to receive a 6-digit code.</Text>
|
|
94
|
+
</View>
|
|
95
|
+
{step === 'request' && (
|
|
96
|
+
<>
|
|
97
|
+
<TextField
|
|
98
|
+
ref={identifierRef}
|
|
99
|
+
label="Email or Username"
|
|
100
|
+
icon="mail-outline"
|
|
101
|
+
value={identifier}
|
|
102
|
+
onChangeText={setIdentifier}
|
|
103
|
+
autoCapitalize="none"
|
|
104
|
+
autoCorrect={false}
|
|
105
|
+
colors={colors}
|
|
106
|
+
variant="filled"
|
|
107
|
+
error={errorMessage || undefined}
|
|
108
|
+
editable={!isLoading}
|
|
109
|
+
autoFocus
|
|
110
|
+
testID="recover-identifier-input"
|
|
111
|
+
validMessage={successMessage || undefined}
|
|
112
|
+
onSubmitEditing={handleRequestWithFocus}
|
|
113
|
+
/>
|
|
114
|
+
<GroupedPillButtons
|
|
115
|
+
buttons={[
|
|
116
|
+
{
|
|
117
|
+
text: 'Back to Sign In',
|
|
118
|
+
onPress: () => navigate('SignIn'),
|
|
119
|
+
icon: 'arrow-back',
|
|
120
|
+
variant: 'transparent',
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
text: 'Send Code',
|
|
124
|
+
onPress: handleRequest,
|
|
125
|
+
icon: 'mail-open-outline',
|
|
126
|
+
variant: 'primary',
|
|
127
|
+
loading: isLoading,
|
|
128
|
+
disabled: isLoading,
|
|
129
|
+
},
|
|
130
|
+
]}
|
|
131
|
+
colors={colors}
|
|
132
|
+
/>
|
|
133
|
+
</>
|
|
134
|
+
)}
|
|
135
|
+
{step === 'code' && (
|
|
136
|
+
<>
|
|
137
|
+
<PinInput
|
|
138
|
+
value={code}
|
|
139
|
+
onChange={setCode}
|
|
140
|
+
length={PIN_LENGTH}
|
|
141
|
+
disabled={isLoading}
|
|
142
|
+
autoFocus
|
|
143
|
+
colors={colors}
|
|
144
|
+
/>
|
|
145
|
+
{successMessage && (
|
|
146
|
+
<View style={styles.belowInputMessage}>
|
|
147
|
+
<Ionicons name="checkmark-circle" size={16} color={colors.success} />
|
|
148
|
+
<Text style={[styles.belowInputText, { color: colors.success }]}>{successMessage}</Text>
|
|
149
|
+
</View>
|
|
150
|
+
)}
|
|
151
|
+
{errorMessage ? (
|
|
152
|
+
<Text style={[styles.successText, { color: colors.error, marginBottom: 12 }]}>{errorMessage}</Text>
|
|
153
|
+
) : null}
|
|
154
|
+
<GroupedPillButtons
|
|
155
|
+
buttons={[
|
|
156
|
+
{
|
|
157
|
+
text: 'Back',
|
|
158
|
+
onPress: () => setStep('request'),
|
|
159
|
+
icon: 'arrow-back',
|
|
160
|
+
variant: 'transparent',
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
text: 'Verify Code',
|
|
164
|
+
onPress: handleVerifyCode,
|
|
165
|
+
icon: 'checkmark-circle-outline',
|
|
166
|
+
variant: 'primary',
|
|
167
|
+
loading: isLoading,
|
|
168
|
+
disabled: isLoading,
|
|
169
|
+
},
|
|
170
|
+
]}
|
|
171
|
+
colors={colors}
|
|
172
|
+
/>
|
|
173
|
+
</>
|
|
174
|
+
)}
|
|
175
|
+
{step === 'done' && (
|
|
176
|
+
<>
|
|
177
|
+
<Text style={[styles.successText, { color: colors.success, marginBottom: 24 }]}>{successMessage}</Text>
|
|
178
|
+
<GroupedPillButtons
|
|
179
|
+
buttons={[
|
|
180
|
+
{
|
|
181
|
+
text: 'Back to Sign In',
|
|
182
|
+
onPress: () => navigate('SignIn'),
|
|
183
|
+
icon: 'arrow-back',
|
|
184
|
+
variant: 'primary',
|
|
185
|
+
},
|
|
186
|
+
]}
|
|
187
|
+
colors={colors}
|
|
188
|
+
/>
|
|
189
|
+
</>
|
|
190
|
+
)}
|
|
191
|
+
</Animated.View>
|
|
192
|
+
</ScrollView>
|
|
193
|
+
</KeyboardAvoidingView>
|
|
194
|
+
);
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
const createStyles = (colors: any) => StyleSheet.create({
|
|
198
|
+
container: {
|
|
199
|
+
flex: 1,
|
|
200
|
+
},
|
|
201
|
+
scrollContent: {
|
|
202
|
+
flexGrow: 1,
|
|
203
|
+
paddingHorizontal: 24,
|
|
204
|
+
paddingTop: 4,
|
|
205
|
+
paddingBottom: 20,
|
|
206
|
+
},
|
|
207
|
+
stepContainer: {
|
|
208
|
+
flex: 1,
|
|
209
|
+
justifyContent: 'flex-start',
|
|
210
|
+
alignItems: 'flex-start',
|
|
211
|
+
},
|
|
212
|
+
modernHeader: {
|
|
213
|
+
alignItems: 'flex-start',
|
|
214
|
+
width: '100%',
|
|
215
|
+
marginBottom: 24,
|
|
216
|
+
},
|
|
217
|
+
modernTitle: {
|
|
218
|
+
fontFamily: Platform.OS === 'web' ? 'Phudu' : 'Phudu-Bold',
|
|
219
|
+
fontWeight: Platform.OS === 'web' ? 'bold' : undefined,
|
|
220
|
+
fontSize: 62,
|
|
221
|
+
lineHeight: 48,
|
|
222
|
+
marginBottom: 18,
|
|
223
|
+
textAlign: 'left',
|
|
224
|
+
letterSpacing: -1,
|
|
225
|
+
},
|
|
226
|
+
modernSubtitle: {
|
|
227
|
+
fontSize: 18,
|
|
228
|
+
lineHeight: 24,
|
|
229
|
+
textAlign: 'left',
|
|
230
|
+
opacity: 0.8,
|
|
231
|
+
marginBottom: 24,
|
|
232
|
+
},
|
|
233
|
+
successCard: {
|
|
234
|
+
flexDirection: 'row',
|
|
235
|
+
alignItems: 'center',
|
|
236
|
+
padding: 16,
|
|
237
|
+
borderRadius: 16,
|
|
238
|
+
marginBottom: 24,
|
|
239
|
+
gap: 12,
|
|
240
|
+
width: '100%',
|
|
241
|
+
},
|
|
242
|
+
belowInputMessage: {
|
|
243
|
+
flexDirection: 'row',
|
|
244
|
+
alignItems: 'center',
|
|
245
|
+
marginTop: 4,
|
|
246
|
+
marginBottom: 0,
|
|
247
|
+
gap: 6,
|
|
248
|
+
},
|
|
249
|
+
belowInputText: {
|
|
250
|
+
fontSize: 13,
|
|
251
|
+
fontWeight: '500',
|
|
252
|
+
},
|
|
253
|
+
successText: {
|
|
254
|
+
fontSize: 14,
|
|
255
|
+
fontWeight: '500',
|
|
256
|
+
flex: 1,
|
|
257
|
+
},
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
export default RecoverAccountScreen;
|
|
@@ -15,19 +15,8 @@ import { useOxy } from '../context/OxyContext';
|
|
|
15
15
|
import { fontFamilies } from '../styles/fonts';
|
|
16
16
|
import { toast } from '../../lib/sonner';
|
|
17
17
|
import { Ionicons } from '@expo/vector-icons';
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
id: string;
|
|
21
|
-
deviceName?: string;
|
|
22
|
-
deviceType: string;
|
|
23
|
-
platform: string;
|
|
24
|
-
browser?: string;
|
|
25
|
-
ipAddress?: string;
|
|
26
|
-
userAgent?: string;
|
|
27
|
-
lastActivity: string;
|
|
28
|
-
createdAt: string;
|
|
29
|
-
isCurrent: boolean;
|
|
30
|
-
}
|
|
18
|
+
import { SecureClientSession } from '../../models/secureSession';
|
|
19
|
+
import { confirmAction } from '../utils/confirmAction';
|
|
31
20
|
|
|
32
21
|
const SessionManagementScreen: React.FC<BaseScreenProps> = ({
|
|
33
22
|
onClose,
|
|
@@ -58,11 +47,15 @@ const SessionManagementScreen: React.FC<BaseScreenProps> = ({
|
|
|
58
47
|
await refreshSessions();
|
|
59
48
|
} catch (error) {
|
|
60
49
|
console.error('Failed to load sessions:', error);
|
|
61
|
-
|
|
62
|
-
'
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
50
|
+
if (Platform.OS === 'web') {
|
|
51
|
+
toast.error('Failed to load sessions. Please try again.');
|
|
52
|
+
} else {
|
|
53
|
+
Alert.alert(
|
|
54
|
+
'Error',
|
|
55
|
+
'Failed to load sessions. Please try again.',
|
|
56
|
+
[{ text: 'OK' }]
|
|
57
|
+
);
|
|
58
|
+
}
|
|
66
59
|
} finally {
|
|
67
60
|
setLoading(false);
|
|
68
61
|
setRefreshing(false);
|
|
@@ -70,99 +63,62 @@ const SessionManagementScreen: React.FC<BaseScreenProps> = ({
|
|
|
70
63
|
};
|
|
71
64
|
|
|
72
65
|
const handleLogoutSession = async (sessionId: string) => {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
// Refresh sessions to update the list
|
|
87
|
-
await refreshSessions();
|
|
88
|
-
|
|
89
|
-
toast.success('Session logged out successfully');
|
|
90
|
-
} catch (error) {
|
|
91
|
-
console.error('Logout session failed:', error);
|
|
92
|
-
toast.error('Failed to logout session. Please try again.');
|
|
93
|
-
} finally {
|
|
94
|
-
setActionLoading(null);
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
]
|
|
99
|
-
);
|
|
66
|
+
confirmAction('Are you sure you want to logout this session?', async () => {
|
|
67
|
+
try {
|
|
68
|
+
setActionLoading(sessionId);
|
|
69
|
+
await logout(sessionId);
|
|
70
|
+
await refreshSessions();
|
|
71
|
+
toast.success('Session logged out successfully');
|
|
72
|
+
} catch (error) {
|
|
73
|
+
console.error('Logout session failed:', error);
|
|
74
|
+
toast.error('Failed to logout session. Please try again.');
|
|
75
|
+
} finally {
|
|
76
|
+
setActionLoading(null);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
100
79
|
};
|
|
101
80
|
|
|
102
81
|
const handleLogoutOtherSessions = async () => {
|
|
103
82
|
const otherSessionsCount = userSessions.filter(s => s.sessionId !== activeSessionId).length;
|
|
104
|
-
|
|
105
83
|
if (otherSessionsCount === 0) {
|
|
106
84
|
toast.info('No other sessions to logout.');
|
|
107
85
|
return;
|
|
108
86
|
}
|
|
109
|
-
|
|
110
|
-
Alert.alert(
|
|
111
|
-
'Logout Other Sessions',
|
|
87
|
+
confirmAction(
|
|
112
88
|
`This will logout ${otherSessionsCount} other session${otherSessionsCount > 1 ? 's' : ''}. Continue?`,
|
|
113
|
-
|
|
114
|
-
{
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
try {
|
|
120
|
-
setActionLoading('others');
|
|
121
|
-
// Logout each non-active session
|
|
122
|
-
for (const session of userSessions) {
|
|
123
|
-
if (session.sessionId !== activeSessionId) {
|
|
124
|
-
await logout(session.sessionId);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
// Refresh sessions to update the list
|
|
129
|
-
await refreshSessions();
|
|
130
|
-
|
|
131
|
-
toast.success('Other sessions logged out successfully');
|
|
132
|
-
} catch (error) {
|
|
133
|
-
console.error('Logout other sessions failed:', error);
|
|
134
|
-
toast.error('Failed to logout other sessions. Please try again.');
|
|
135
|
-
} finally {
|
|
136
|
-
setActionLoading(null);
|
|
89
|
+
async () => {
|
|
90
|
+
try {
|
|
91
|
+
setActionLoading('others');
|
|
92
|
+
for (const session of userSessions) {
|
|
93
|
+
if (session.sessionId !== activeSessionId) {
|
|
94
|
+
await logout(session.sessionId);
|
|
137
95
|
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
|
|
96
|
+
}
|
|
97
|
+
await refreshSessions();
|
|
98
|
+
toast.success('Other sessions logged out successfully');
|
|
99
|
+
} catch (error) {
|
|
100
|
+
console.error('Logout other sessions failed:', error);
|
|
101
|
+
toast.error('Failed to logout other sessions. Please try again.');
|
|
102
|
+
} finally {
|
|
103
|
+
setActionLoading(null);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
141
106
|
);
|
|
142
107
|
};
|
|
143
108
|
|
|
144
109
|
const handleLogoutAllSessions = async () => {
|
|
145
|
-
|
|
146
|
-
'Logout All Sessions',
|
|
110
|
+
confirmAction(
|
|
147
111
|
'This will logout all sessions including this one and you will need to sign in again. Continue?',
|
|
148
|
-
|
|
149
|
-
{
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
} catch (error) {
|
|
159
|
-
console.error('Logout all sessions failed:', error);
|
|
160
|
-
toast.error('Failed to logout all sessions. Please try again.');
|
|
161
|
-
setActionLoading(null);
|
|
162
|
-
}
|
|
163
|
-
},
|
|
164
|
-
},
|
|
165
|
-
]
|
|
112
|
+
async () => {
|
|
113
|
+
try {
|
|
114
|
+
setActionLoading('all');
|
|
115
|
+
await oxyServices.logoutAllSessions();
|
|
116
|
+
} catch (error) {
|
|
117
|
+
console.error('Logout all sessions failed:', error);
|
|
118
|
+
toast.error('Failed to logout all sessions. Please try again.');
|
|
119
|
+
setActionLoading(null);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
166
122
|
);
|
|
167
123
|
};
|
|
168
124
|
|
|
@@ -175,7 +131,7 @@ const SessionManagementScreen: React.FC<BaseScreenProps> = ({
|
|
|
175
131
|
if (diffInMinutes < 60) return `${diffInMinutes}m ago`;
|
|
176
132
|
if (diffInMinutes < 1440) return `${Math.floor(diffInMinutes / 60)}h ago`;
|
|
177
133
|
if (diffInMinutes < 10080) return `${Math.floor(diffInMinutes / 1440)}d ago`;
|
|
178
|
-
|
|
134
|
+
|
|
179
135
|
return date.toLocaleDateString();
|
|
180
136
|
};
|
|
181
137
|
|
|
@@ -212,11 +168,8 @@ const SessionManagementScreen: React.FC<BaseScreenProps> = ({
|
|
|
212
168
|
<View style={[styles.container, { backgroundColor }]}>
|
|
213
169
|
<View style={styles.header}>
|
|
214
170
|
<Text style={[styles.title, { color: textColor }]}>Active Sessions</Text>
|
|
215
|
-
<Text style={[styles.subtitle, { color: isDarkTheme ? '#BBBBBB' : '#666666' }]}>
|
|
216
|
-
Manage your active sessions across all devices
|
|
217
|
-
</Text>
|
|
171
|
+
<Text style={[styles.subtitle, { color: isDarkTheme ? '#BBBBBB' : '#666666' }]}>Manage your active sessions across all devices</Text>
|
|
218
172
|
</View>
|
|
219
|
-
|
|
220
173
|
<ScrollView
|
|
221
174
|
style={styles.scrollView}
|
|
222
175
|
contentContainerStyle={styles.scrollContainer}
|
|
@@ -230,7 +183,7 @@ const SessionManagementScreen: React.FC<BaseScreenProps> = ({
|
|
|
230
183
|
>
|
|
231
184
|
{userSessions.length > 0 ? (
|
|
232
185
|
<>
|
|
233
|
-
{userSessions.map((session) => (
|
|
186
|
+
{userSessions.map((session: SecureClientSession) => (
|
|
234
187
|
<View
|
|
235
188
|
key={session.sessionId}
|
|
236
189
|
style={[
|
|
@@ -244,34 +197,20 @@ const SessionManagementScreen: React.FC<BaseScreenProps> = ({
|
|
|
244
197
|
>
|
|
245
198
|
<View style={styles.sessionHeader}>
|
|
246
199
|
<View style={styles.sessionTitleRow}>
|
|
247
|
-
<Text style={styles.deviceIcon}>
|
|
248
|
-
📱
|
|
249
|
-
</Text>
|
|
200
|
+
<Text style={styles.deviceIcon}>💻</Text>
|
|
250
201
|
<View style={styles.sessionTitleText}>
|
|
251
|
-
<Text style={[styles.deviceName, { color: textColor }]}>
|
|
252
|
-
Session {session.sessionId.substring(0, 8)}...
|
|
253
|
-
</Text>
|
|
202
|
+
<Text style={[styles.deviceName, { color: textColor }]}>Session {session.sessionId.substring(0, 8)}...</Text>
|
|
254
203
|
{session.sessionId === activeSessionId && (
|
|
255
|
-
<Text style={[styles.currentBadge, { color: successColor }]}>
|
|
256
|
-
Current Session
|
|
257
|
-
</Text>
|
|
204
|
+
<Text style={[styles.currentBadge, { color: successColor }]}>Current Session</Text>
|
|
258
205
|
)}
|
|
259
206
|
</View>
|
|
260
207
|
</View>
|
|
261
208
|
</View>
|
|
262
|
-
|
|
263
209
|
<View style={styles.sessionDetails}>
|
|
264
|
-
<Text style={[styles.sessionDetail, { color: isDarkTheme ? '#BBBBBB' : '#666666' }]}>
|
|
265
|
-
|
|
266
|
-
</Text>
|
|
267
|
-
<Text style={[styles.sessionDetail, { color: isDarkTheme ? '#BBBBBB' : '#666666' }]}>
|
|
268
|
-
Last active: {new Date(session.lastActive).toLocaleDateString()}
|
|
269
|
-
</Text>
|
|
270
|
-
<Text style={[styles.sessionDetail, { color: isDarkTheme ? '#BBBBBB' : '#666666' }]}>
|
|
271
|
-
Expires: {new Date(session.expiresAt).toLocaleDateString()}
|
|
272
|
-
</Text>
|
|
210
|
+
<Text style={[styles.sessionDetail, { color: isDarkTheme ? '#BBBBBB' : '#666666' }]}>Device ID: {session.deviceId ? session.deviceId.substring(0, 12) + '...' : 'Unknown'}</Text>
|
|
211
|
+
<Text style={[styles.sessionDetail, { color: isDarkTheme ? '#BBBBBB' : '#666666' }]}>Last active: {session.lastActive ? new Date(session.lastActive).toLocaleDateString() : 'Unknown'}</Text>
|
|
212
|
+
<Text style={[styles.sessionDetail, { color: isDarkTheme ? '#BBBBBB' : '#666666' }]}>Expires: {session.expiresAt ? new Date(session.expiresAt).toLocaleDateString() : 'Unknown'}</Text>
|
|
273
213
|
</View>
|
|
274
|
-
|
|
275
214
|
{session.sessionId !== activeSessionId && (
|
|
276
215
|
<TouchableOpacity
|
|
277
216
|
style={[styles.logoutButton, { backgroundColor: isDarkTheme ? '#400000' : '#FFEBEE' }]}
|
|
@@ -281,15 +220,12 @@ const SessionManagementScreen: React.FC<BaseScreenProps> = ({
|
|
|
281
220
|
{actionLoading === session.sessionId ? (
|
|
282
221
|
<ActivityIndicator size="small" color={dangerColor} />
|
|
283
222
|
) : (
|
|
284
|
-
<Text style={[styles.logoutButtonText, { color: dangerColor }]}>
|
|
285
|
-
Logout
|
|
286
|
-
</Text>
|
|
223
|
+
<Text style={[styles.logoutButtonText, { color: dangerColor }]}>Logout</Text>
|
|
287
224
|
)}
|
|
288
225
|
</TouchableOpacity>
|
|
289
226
|
)}
|
|
290
227
|
</View>
|
|
291
228
|
))}
|
|
292
|
-
|
|
293
229
|
<View style={styles.bulkActions}>
|
|
294
230
|
<TouchableOpacity
|
|
295
231
|
style={[styles.bulkActionButton, { backgroundColor: isDarkTheme ? '#1A1A1A' : '#F0F0F0', borderColor }]}
|
|
@@ -299,12 +235,9 @@ const SessionManagementScreen: React.FC<BaseScreenProps> = ({
|
|
|
299
235
|
{actionLoading === 'others' ? (
|
|
300
236
|
<ActivityIndicator size="small" color={primaryColor} />
|
|
301
237
|
) : (
|
|
302
|
-
<Text style={[styles.bulkActionButtonText, { color: textColor }]}>
|
|
303
|
-
Logout Other Sessions
|
|
304
|
-
</Text>
|
|
238
|
+
<Text style={[styles.bulkActionButtonText, { color: textColor }]}>Logout Other Sessions</Text>
|
|
305
239
|
)}
|
|
306
240
|
</TouchableOpacity>
|
|
307
|
-
|
|
308
241
|
<TouchableOpacity
|
|
309
242
|
style={[styles.bulkActionButton, styles.dangerButton, { backgroundColor: isDarkTheme ? '#400000' : '#FFEBEE' }]}
|
|
310
243
|
onPress={handleLogoutAllSessions}
|
|
@@ -313,22 +246,17 @@ const SessionManagementScreen: React.FC<BaseScreenProps> = ({
|
|
|
313
246
|
{actionLoading === 'all' ? (
|
|
314
247
|
<ActivityIndicator size="small" color={dangerColor} />
|
|
315
248
|
) : (
|
|
316
|
-
<Text style={[styles.bulkActionButtonText, { color: dangerColor }]}>
|
|
317
|
-
Logout All Sessions
|
|
318
|
-
</Text>
|
|
249
|
+
<Text style={[styles.bulkActionButtonText, { color: dangerColor }]}>Logout All Sessions</Text>
|
|
319
250
|
)}
|
|
320
251
|
</TouchableOpacity>
|
|
321
252
|
</View>
|
|
322
253
|
</>
|
|
323
254
|
) : (
|
|
324
255
|
<View style={styles.emptyState}>
|
|
325
|
-
<Text style={[styles.emptyStateText, { color: isDarkTheme ? '#BBBBBB' : '#666666' }]}>
|
|
326
|
-
No active sessions found
|
|
327
|
-
</Text>
|
|
256
|
+
<Text style={[styles.emptyStateText, { color: isDarkTheme ? '#BBBBBB' : '#666666' }]}>No active sessions found</Text>
|
|
328
257
|
</View>
|
|
329
258
|
)}
|
|
330
259
|
</ScrollView>
|
|
331
|
-
|
|
332
260
|
<View style={[styles.footer, { borderTopColor: borderColor }]}>
|
|
333
261
|
<TouchableOpacity style={styles.closeButton} onPress={onClose}>
|
|
334
262
|
<Text style={[styles.closeButtonText, { color: primaryColor }]}>Close</Text>
|