@oxyhq/services 25.0.1 → 26.0.1
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 +2 -2
- package/android/src/main/java/so/oxy/identity/OxyIdentityStore.kt +127 -21
- package/expo-module.config.json +1 -4
- package/lib/commonjs/index.js +49 -18
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/notifications/deviceNotifications.js +0 -63
- package/lib/commonjs/notifications/deviceNotifications.js.map +1 -1
- package/lib/commonjs/ui/boot/runProviderColdBoot.js +64 -20
- package/lib/commonjs/ui/boot/runProviderColdBoot.js.map +1 -1
- package/lib/commonjs/ui/components/FollowButton.js +4 -4
- package/lib/commonjs/ui/components/FollowButton.js.map +1 -1
- package/lib/commonjs/ui/components/OxyAccountDialogScreen.js +1 -13
- package/lib/commonjs/ui/components/OxyAccountDialogScreen.js.map +1 -1
- package/lib/commonjs/ui/components/OxyAuthChooser.js +8 -9
- package/lib/commonjs/ui/components/OxyAuthChooser.js.map +1 -1
- package/lib/commonjs/ui/components/OxyProvider.js +7 -8
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/components/ProfileButton.js +1 -1
- package/lib/commonjs/ui/components/ProfileButton.js.map +1 -1
- package/lib/commonjs/ui/components/authChooser/AccountsMenuView.js +30 -25
- package/lib/commonjs/ui/components/authChooser/AccountsMenuView.js.map +1 -1
- package/lib/commonjs/ui/components/authChooser/primitives.js +9 -9
- package/lib/commonjs/ui/components/authChooser/primitives.js.map +1 -1
- package/lib/commonjs/ui/components/authChooser/useUsernameAvailability.js +2 -2
- package/lib/commonjs/ui/components/authChooser/useUsernameAvailability.js.map +1 -1
- package/lib/commonjs/ui/components/fileManagement/UploadPreview.js +2 -2
- package/lib/commonjs/ui/components/fileManagement/UploadPreview.js.map +1 -1
- package/lib/commonjs/ui/components/internal/PinInput.js +1 -3
- package/lib/commonjs/ui/components/internal/PinInput.js.map +1 -1
- package/lib/commonjs/ui/components/logo/LogoText.js +4 -4
- package/lib/commonjs/ui/components/logo/LogoText.js.map +1 -1
- package/lib/commonjs/ui/components/payment/PaymentDetailsStep.js +2 -2
- package/lib/commonjs/ui/components/payment/PaymentDetailsStep.js.map +1 -1
- package/lib/commonjs/ui/components/payment/PaymentSummaryStep.js +2 -2
- package/lib/commonjs/ui/components/payment/PaymentSummaryStep.js.map +1 -1
- package/lib/commonjs/ui/components/styles/shadow.js.map +1 -1
- package/lib/commonjs/ui/context/OxyContext.js +46 -32
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/context/commitSessionFlow.js +43 -3
- package/lib/commonjs/ui/context/commitSessionFlow.js.map +1 -1
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js +2 -15
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js.map +1 -1
- package/lib/commonjs/ui/context/useOxyAccountGraph.js +4 -3
- package/lib/commonjs/ui/context/useOxyAccountGraph.js.map +1 -1
- package/lib/commonjs/ui/hooks/mutations/mutationFactory.js +5 -5
- package/lib/commonjs/ui/hooks/mutations/mutationFactory.js.map +1 -1
- package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js +11 -11
- package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js.map +1 -1
- package/lib/commonjs/ui/hooks/mutations/useServicesMutations.js +9 -9
- package/lib/commonjs/ui/hooks/mutations/useServicesMutations.js.map +1 -1
- package/lib/commonjs/ui/hooks/queries/usePaymentQueries.js +2 -3
- package/lib/commonjs/ui/hooks/queries/usePaymentQueries.js.map +1 -1
- package/lib/commonjs/ui/hooks/queries/userCache.js +17 -17
- package/lib/commonjs/ui/hooks/queries/userCache.js.map +1 -1
- package/lib/commonjs/ui/hooks/useAssets.js.map +1 -1
- package/lib/commonjs/ui/hooks/useAsyncAction.js +7 -7
- package/lib/commonjs/ui/hooks/useAsyncAction.js.map +1 -1
- package/lib/commonjs/ui/hooks/useAuth.js +2 -4
- package/lib/commonjs/ui/hooks/useAuth.js.map +1 -1
- package/lib/commonjs/ui/hooks/useAvatarPicker.js +5 -5
- package/lib/commonjs/ui/hooks/useAvatarPicker.js.map +1 -1
- package/lib/commonjs/ui/hooks/useOnlineStatus.js +2 -3
- package/lib/commonjs/ui/hooks/useOnlineStatus.js.map +1 -1
- package/lib/commonjs/ui/hooks/useSessionManagement.js +2 -0
- package/lib/commonjs/ui/hooks/useSessionManagement.js.map +1 -1
- package/lib/commonjs/ui/hooks/useSettingToggle.js +4 -4
- package/lib/commonjs/ui/hooks/useSettingToggle.js.map +1 -1
- package/lib/commonjs/ui/hooks/useSurfaceHeader.js +11 -68
- package/lib/commonjs/ui/hooks/useSurfaceHeader.js.map +1 -1
- package/lib/commonjs/ui/oauth/browserAuthTransport.js +64 -66
- package/lib/commonjs/ui/oauth/browserAuthTransport.js.map +1 -1
- package/lib/commonjs/ui/oauth/legacyRedirectLanes.js +48 -0
- package/lib/commonjs/ui/oauth/legacyRedirectLanes.js.map +1 -0
- package/lib/commonjs/ui/oauth/oauthPopup.js +0 -47
- package/lib/commonjs/ui/oauth/oauthPopup.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountMembersScreen.js +10 -10
- package/lib/commonjs/ui/screens/AccountMembersScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js +8 -7
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountVerificationScreen.js +4 -4
- package/lib/commonjs/ui/screens/AccountVerificationScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AppInfoScreen.js +9 -9
- package/lib/commonjs/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AvatarCropScreen.js +3 -3
- package/lib/commonjs/ui/screens/AvatarCropScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ChangeAvatarScreen.js +7 -6
- package/lib/commonjs/ui/screens/ChangeAvatarScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ConnectedAppsScreen.js +4 -4
- package/lib/commonjs/ui/screens/ConnectedAppsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/CreateAccountScreen.js +3 -3
- package/lib/commonjs/ui/screens/CreateAccountScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js +3 -3
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/EditProfileScreen.js +3 -2
- package/lib/commonjs/ui/screens/EditProfileScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FAQScreen.js +2 -2
- package/lib/commonjs/ui/screens/FAQScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FeedbackScreen.js +89 -90
- package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FileManagementScreen.js +20 -20
- package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FollowersListScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FollowingListScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HelpSupportScreen.js +7 -7
- package/lib/commonjs/ui/screens/HelpSupportScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HistoryViewScreen.js +34 -9
- package/lib/commonjs/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js +3 -3
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LegalDocumentsScreen.js +3 -3
- package/lib/commonjs/ui/screens/LegalDocumentsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ManageAccountScreen.js +15 -15
- package/lib/commonjs/ui/screens/ManageAccountScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +19 -19
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js +15 -15
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ProfileScreen.js +7 -17
- package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SavesCollectionsScreen.js +2 -2
- package/lib/commonjs/ui/screens/SavesCollectionsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/UserListScreen.js +7 -13
- package/lib/commonjs/ui/screens/UserListScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js +6 -5
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/fileManagement/PhotoPickerSection.js +4 -1
- package/lib/commonjs/ui/screens/fileManagement/PhotoPickerSection.js.map +1 -1
- package/lib/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.js +24 -34
- package/lib/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js +1 -1
- package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustLeaderboardScreen.js +4 -3
- package/lib/commonjs/ui/screens/trust/TrustLeaderboardScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustRewardsScreen.js +1 -1
- package/lib/commonjs/ui/screens/trust/TrustRewardsScreen.js.map +1 -1
- package/lib/commonjs/ui/session/index.js +0 -7
- package/lib/commonjs/ui/session/index.js.map +1 -1
- package/lib/commonjs/ui/utils/crossOriginRestore.js +140 -0
- package/lib/commonjs/ui/utils/crossOriginRestore.js.map +1 -0
- package/lib/commonjs/ui/utils/fileManagement.js +24 -24
- package/lib/commonjs/ui/utils/fileManagement.js.map +1 -1
- package/lib/commonjs/ui/utils/oauthReturn.js +30 -19
- package/lib/commonjs/ui/utils/oauthReturn.js.map +1 -1
- package/lib/commonjs/ui/utils/userUtils.js +28 -27
- package/lib/commonjs/ui/utils/userUtils.js.map +1 -1
- package/lib/module/index.js +8 -20
- package/lib/module/index.js.map +1 -1
- package/lib/module/notifications/deviceNotifications.js +0 -62
- package/lib/module/notifications/deviceNotifications.js.map +1 -1
- package/lib/module/ui/boot/runProviderColdBoot.js +65 -21
- package/lib/module/ui/boot/runProviderColdBoot.js.map +1 -1
- package/lib/module/ui/components/FollowButton.js +1 -1
- package/lib/module/ui/components/FollowButton.js.map +1 -1
- package/lib/module/ui/components/OxyAccountDialogScreen.js +1 -13
- package/lib/module/ui/components/OxyAccountDialogScreen.js.map +1 -1
- package/lib/module/ui/components/OxyAuthChooser.js +4 -5
- package/lib/module/ui/components/OxyAuthChooser.js.map +1 -1
- package/lib/module/ui/components/OxyProvider.js +6 -7
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/components/ProfileButton.js +2 -2
- package/lib/module/ui/components/ProfileButton.js.map +1 -1
- package/lib/module/ui/components/authChooser/AccountsMenuView.js +8 -3
- package/lib/module/ui/components/authChooser/AccountsMenuView.js.map +1 -1
- package/lib/module/ui/components/authChooser/primitives.js +1 -1
- package/lib/module/ui/components/authChooser/primitives.js.map +1 -1
- package/lib/module/ui/components/authChooser/useUsernameAvailability.js +1 -1
- package/lib/module/ui/components/authChooser/useUsernameAvailability.js.map +1 -1
- package/lib/module/ui/components/fileManagement/UploadPreview.js +1 -1
- package/lib/module/ui/components/fileManagement/UploadPreview.js.map +1 -1
- package/lib/module/ui/components/internal/PinInput.js +1 -3
- package/lib/module/ui/components/internal/PinInput.js.map +1 -1
- package/lib/module/ui/components/logo/LogoText.js +4 -4
- package/lib/module/ui/components/logo/LogoText.js.map +1 -1
- package/lib/module/ui/components/payment/PaymentDetailsStep.js +1 -1
- package/lib/module/ui/components/payment/PaymentDetailsStep.js.map +1 -1
- package/lib/module/ui/components/payment/PaymentSummaryStep.js +2 -2
- package/lib/module/ui/components/payment/PaymentSummaryStep.js.map +1 -1
- package/lib/module/ui/components/styles/shadow.js.map +1 -1
- package/lib/module/ui/context/OxyContext.js +49 -35
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/context/commitSessionFlow.js +42 -3
- package/lib/module/ui/context/commitSessionFlow.js.map +1 -1
- package/lib/module/ui/context/hooks/useAuthOperations.js +2 -15
- package/lib/module/ui/context/hooks/useAuthOperations.js.map +1 -1
- package/lib/module/ui/context/useOxyAccountGraph.js +4 -3
- package/lib/module/ui/context/useOxyAccountGraph.js.map +1 -1
- package/lib/module/ui/hooks/mutations/mutationFactory.js +1 -1
- package/lib/module/ui/hooks/mutations/mutationFactory.js.map +1 -1
- package/lib/module/ui/hooks/mutations/useAccountMutations.js +1 -1
- package/lib/module/ui/hooks/mutations/useAccountMutations.js.map +1 -1
- package/lib/module/ui/hooks/mutations/useServicesMutations.js +1 -1
- package/lib/module/ui/hooks/mutations/useServicesMutations.js.map +1 -1
- package/lib/module/ui/hooks/queries/usePaymentQueries.js +2 -3
- package/lib/module/ui/hooks/queries/usePaymentQueries.js.map +1 -1
- package/lib/module/ui/hooks/queries/userCache.js +17 -17
- package/lib/module/ui/hooks/queries/userCache.js.map +1 -1
- package/lib/module/ui/hooks/useAssets.js.map +1 -1
- package/lib/module/ui/hooks/useAsyncAction.js +1 -1
- package/lib/module/ui/hooks/useAsyncAction.js.map +1 -1
- package/lib/module/ui/hooks/useAuth.js +2 -4
- package/lib/module/ui/hooks/useAuth.js.map +1 -1
- package/lib/module/ui/hooks/useAvatarPicker.js +1 -1
- package/lib/module/ui/hooks/useAvatarPicker.js.map +1 -1
- package/lib/module/ui/hooks/useOnlineStatus.js +2 -3
- package/lib/module/ui/hooks/useOnlineStatus.js.map +1 -1
- package/lib/module/ui/hooks/useSessionManagement.js +2 -0
- package/lib/module/ui/hooks/useSessionManagement.js.map +1 -1
- package/lib/module/ui/hooks/useSettingToggle.js +1 -1
- package/lib/module/ui/hooks/useSettingToggle.js.map +1 -1
- package/lib/module/ui/hooks/useSurfaceHeader.js +11 -68
- package/lib/module/ui/hooks/useSurfaceHeader.js.map +1 -1
- package/lib/module/ui/oauth/browserAuthTransport.js +64 -66
- package/lib/module/ui/oauth/browserAuthTransport.js.map +1 -1
- package/lib/module/ui/oauth/legacyRedirectLanes.js +44 -0
- package/lib/module/ui/oauth/legacyRedirectLanes.js.map +1 -0
- package/lib/module/ui/oauth/oauthPopup.js +1 -48
- package/lib/module/ui/oauth/oauthPopup.js.map +1 -1
- package/lib/module/ui/screens/AccountMembersScreen.js +1 -1
- package/lib/module/ui/screens/AccountMembersScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSettingsScreen.js +4 -3
- package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountVerificationScreen.js +1 -1
- package/lib/module/ui/screens/AccountVerificationScreen.js.map +1 -1
- package/lib/module/ui/screens/AppInfoScreen.js +1 -1
- package/lib/module/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/module/ui/screens/AvatarCropScreen.js +1 -1
- package/lib/module/ui/screens/AvatarCropScreen.js.map +1 -1
- package/lib/module/ui/screens/ChangeAvatarScreen.js +5 -4
- package/lib/module/ui/screens/ChangeAvatarScreen.js.map +1 -1
- package/lib/module/ui/screens/ConnectedAppsScreen.js +2 -2
- package/lib/module/ui/screens/ConnectedAppsScreen.js.map +1 -1
- package/lib/module/ui/screens/CreateAccountScreen.js +1 -1
- package/lib/module/ui/screens/CreateAccountScreen.js.map +1 -1
- package/lib/module/ui/screens/EditProfileFieldScreen.js +1 -1
- package/lib/module/ui/screens/EditProfileFieldScreen.js.map +1 -1
- package/lib/module/ui/screens/EditProfileScreen.js +4 -3
- package/lib/module/ui/screens/EditProfileScreen.js.map +1 -1
- package/lib/module/ui/screens/FAQScreen.js +1 -1
- package/lib/module/ui/screens/FAQScreen.js.map +1 -1
- package/lib/module/ui/screens/FeedbackScreen.js +91 -94
- package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/module/ui/screens/FileManagementScreen.js +1 -1
- package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/FollowersListScreen.js.map +1 -1
- package/lib/module/ui/screens/FollowingListScreen.js.map +1 -1
- package/lib/module/ui/screens/HelpSupportScreen.js +1 -1
- package/lib/module/ui/screens/HelpSupportScreen.js.map +1 -1
- package/lib/module/ui/screens/HistoryViewScreen.js +30 -5
- package/lib/module/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/module/ui/screens/LanguageSelectorScreen.js +1 -1
- package/lib/module/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/module/ui/screens/LegalDocumentsScreen.js +1 -1
- package/lib/module/ui/screens/LegalDocumentsScreen.js.map +1 -1
- package/lib/module/ui/screens/ManageAccountScreen.js +3 -3
- package/lib/module/ui/screens/ManageAccountScreen.js.map +1 -1
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js +4 -4
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/module/ui/screens/PrivacySettingsScreen.js +11 -11
- package/lib/module/ui/screens/PrivacySettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/ProfileScreen.js +8 -18
- package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/module/ui/screens/SavesCollectionsScreen.js +1 -1
- package/lib/module/ui/screens/SavesCollectionsScreen.js.map +1 -1
- package/lib/module/ui/screens/UserListScreen.js +8 -14
- package/lib/module/ui/screens/UserListScreen.js.map +1 -1
- package/lib/module/ui/screens/WelcomeNewUserScreen.js +6 -5
- package/lib/module/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/module/ui/screens/fileManagement/PhotoPickerSection.js +4 -1
- package/lib/module/ui/screens/fileManagement/PhotoPickerSection.js.map +1 -1
- package/lib/module/ui/screens/fileManagement/hooks/useFileUploadState.js +5 -15
- package/lib/module/ui/screens/fileManagement/hooks/useFileUploadState.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustCenterScreen.js +1 -1
- package/lib/module/ui/screens/trust/TrustCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustLeaderboardScreen.js +5 -4
- package/lib/module/ui/screens/trust/TrustLeaderboardScreen.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustRewardsScreen.js +1 -1
- package/lib/module/ui/screens/trust/TrustRewardsScreen.js.map +1 -1
- package/lib/module/ui/session/index.js +0 -1
- package/lib/module/ui/session/index.js.map +1 -1
- package/lib/module/ui/utils/crossOriginRestore.js +131 -0
- package/lib/module/ui/utils/crossOriginRestore.js.map +1 -0
- package/lib/module/ui/utils/fileManagement.js +25 -25
- package/lib/module/ui/utils/fileManagement.js.map +1 -1
- package/lib/module/ui/utils/oauthReturn.js +30 -20
- package/lib/module/ui/utils/oauthReturn.js.map +1 -1
- package/lib/module/ui/utils/userUtils.js +28 -27
- package/lib/module/ui/utils/userUtils.js.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +2 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/notifications/deviceNotifications.d.ts +0 -51
- package/lib/typescript/commonjs/notifications/deviceNotifications.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/boot/runProviderColdBoot.d.ts +30 -11
- package/lib/typescript/commonjs/ui/boot/runProviderColdBoot.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyAccountDialogScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts +0 -7
- package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/ProfileButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/authChooser/AccountsMenuView.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/authChooser/primitives.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/authChooser/primitives.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/fileManagement/UploadPreview.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/fileManagement/UploadPreview.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/internal/PinInput.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/payment/types.d.ts +6 -6
- package/lib/typescript/commonjs/ui/components/payment/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/commitSessionFlow.d.ts +40 -0
- package/lib/typescript/commonjs/ui/context/commitSessionFlow.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/hooks/useAuthOperations.d.ts +2 -11
- package/lib/typescript/commonjs/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/oxyContextTypes.d.ts +7 -26
- package/lib/typescript/commonjs/ui/context/oxyContextTypes.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/useOxyAccountGraph.d.ts +1 -0
- package/lib/typescript/commonjs/ui/context/useOxyAccountGraph.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/paymentTypes.d.ts +2 -3
- package/lib/typescript/commonjs/ui/hooks/queries/paymentTypes.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/usePaymentQueries.d.ts +2 -3
- package/lib/typescript/commonjs/ui/hooks/queries/usePaymentQueries.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/userCache.d.ts +2 -2
- package/lib/typescript/commonjs/ui/hooks/queries/userCache.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useAssets.d.ts +1 -1
- package/lib/typescript/commonjs/ui/hooks/useAssets.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useAsyncAction.d.ts +2 -2
- package/lib/typescript/commonjs/ui/hooks/useAsyncAction.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useAuth.d.ts +2 -4
- package/lib/typescript/commonjs/ui/hooks/useAuth.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useOnlineStatus.d.ts +2 -3
- package/lib/typescript/commonjs/ui/hooks/useOnlineStatus.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useSessionManagement.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useSurfaceHeader.d.ts +2 -7
- package/lib/typescript/commonjs/ui/hooks/useSurfaceHeader.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/oauth/browserAuthTransport.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/oauth/legacyRedirectLanes.d.ts +40 -0
- package/lib/typescript/commonjs/ui/oauth/legacyRedirectLanes.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/oauth/oauthPopup.d.ts +0 -6
- package/lib/typescript/commonjs/ui/oauth/oauthPopup.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/ChangeAvatarScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/EditProfileScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/FeedbackScreen.d.ts +2 -2
- package/lib/typescript/commonjs/ui/screens/FeedbackScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/FollowersListScreen.d.ts +0 -3
- package/lib/typescript/commonjs/ui/screens/FollowersListScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/FollowingListScreen.d.ts +0 -3
- package/lib/typescript/commonjs/ui/screens/FollowingListScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/HistoryViewScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/PrivacySettingsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/ProfileScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/UserListScreen.d.ts +0 -7
- package/lib/typescript/commonjs/ui/screens/UserListScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/WelcomeNewUserScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/trust/TrustLeaderboardScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/trust/trustTier.d.ts +1 -1
- package/lib/typescript/commonjs/ui/screens/trust/trustTier.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/session/index.d.ts +0 -1
- package/lib/typescript/commonjs/ui/session/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/types/navigation.d.ts +19 -27
- package/lib/typescript/commonjs/ui/types/navigation.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/crossOriginRestore.d.ts +43 -0
- package/lib/typescript/commonjs/ui/utils/crossOriginRestore.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/utils/fileManagement.d.ts +5 -5
- package/lib/typescript/commonjs/ui/utils/fileManagement.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/oauthReturn.d.ts +12 -15
- package/lib/typescript/commonjs/ui/utils/oauthReturn.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/userUtils.d.ts +14 -7
- package/lib/typescript/commonjs/ui/utils/userUtils.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +2 -0
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/notifications/deviceNotifications.d.ts +0 -51
- package/lib/typescript/module/notifications/deviceNotifications.d.ts.map +1 -1
- package/lib/typescript/module/ui/boot/runProviderColdBoot.d.ts +30 -11
- package/lib/typescript/module/ui/boot/runProviderColdBoot.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyAccountDialogScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts +0 -7
- package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/ProfileButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/authChooser/AccountsMenuView.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/authChooser/primitives.d.ts +1 -1
- package/lib/typescript/module/ui/components/authChooser/primitives.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/fileManagement/UploadPreview.d.ts +1 -1
- package/lib/typescript/module/ui/components/fileManagement/UploadPreview.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/internal/PinInput.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/payment/types.d.ts +6 -6
- package/lib/typescript/module/ui/components/payment/types.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/commitSessionFlow.d.ts +40 -0
- package/lib/typescript/module/ui/context/commitSessionFlow.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/hooks/useAuthOperations.d.ts +2 -11
- package/lib/typescript/module/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/oxyContextTypes.d.ts +7 -26
- package/lib/typescript/module/ui/context/oxyContextTypes.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/useOxyAccountGraph.d.ts +1 -0
- package/lib/typescript/module/ui/context/useOxyAccountGraph.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/queries/paymentTypes.d.ts +2 -3
- package/lib/typescript/module/ui/hooks/queries/paymentTypes.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/queries/usePaymentQueries.d.ts +2 -3
- package/lib/typescript/module/ui/hooks/queries/usePaymentQueries.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/queries/userCache.d.ts +2 -2
- package/lib/typescript/module/ui/hooks/queries/userCache.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useAssets.d.ts +1 -1
- package/lib/typescript/module/ui/hooks/useAssets.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useAsyncAction.d.ts +2 -2
- package/lib/typescript/module/ui/hooks/useAsyncAction.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useAuth.d.ts +2 -4
- package/lib/typescript/module/ui/hooks/useAuth.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useOnlineStatus.d.ts +2 -3
- package/lib/typescript/module/ui/hooks/useOnlineStatus.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useSessionManagement.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useSurfaceHeader.d.ts +2 -7
- package/lib/typescript/module/ui/hooks/useSurfaceHeader.d.ts.map +1 -1
- package/lib/typescript/module/ui/oauth/browserAuthTransport.d.ts.map +1 -1
- package/lib/typescript/module/ui/oauth/legacyRedirectLanes.d.ts +40 -0
- package/lib/typescript/module/ui/oauth/legacyRedirectLanes.d.ts.map +1 -0
- package/lib/typescript/module/ui/oauth/oauthPopup.d.ts +0 -6
- package/lib/typescript/module/ui/oauth/oauthPopup.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/ChangeAvatarScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/EditProfileScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/FeedbackScreen.d.ts +2 -2
- package/lib/typescript/module/ui/screens/FeedbackScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/FollowersListScreen.d.ts +0 -3
- package/lib/typescript/module/ui/screens/FollowersListScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/FollowingListScreen.d.ts +0 -3
- package/lib/typescript/module/ui/screens/FollowingListScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/HistoryViewScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/PrivacySettingsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/ProfileScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/UserListScreen.d.ts +0 -7
- package/lib/typescript/module/ui/screens/UserListScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/WelcomeNewUserScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/fileManagement/hooks/useFileUploadState.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustLeaderboardScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/trust/trustTier.d.ts +1 -1
- package/lib/typescript/module/ui/screens/trust/trustTier.d.ts.map +1 -1
- package/lib/typescript/module/ui/session/index.d.ts +0 -1
- package/lib/typescript/module/ui/session/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/types/navigation.d.ts +19 -27
- package/lib/typescript/module/ui/types/navigation.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/crossOriginRestore.d.ts +43 -0
- package/lib/typescript/module/ui/utils/crossOriginRestore.d.ts.map +1 -0
- package/lib/typescript/module/ui/utils/fileManagement.d.ts +5 -5
- package/lib/typescript/module/ui/utils/fileManagement.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/oauthReturn.d.ts +12 -15
- package/lib/typescript/module/ui/utils/oauthReturn.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/userUtils.d.ts +14 -7
- package/lib/typescript/module/ui/utils/userUtils.d.ts.map +1 -1
- package/package.json +10 -22
- package/src/index.ts +16 -18
- package/src/notifications/deviceNotifications.ts +0 -82
- package/src/ui/boot/__tests__/coldBootWebAuthMode.test.ts +281 -0
- package/src/ui/boot/runProviderColdBoot.ts +101 -24
- package/src/ui/components/FollowButton.tsx +1 -1
- package/src/ui/components/OxyAccountDialogScreen.tsx +1 -13
- package/src/ui/components/OxyAuthChooser.tsx +4 -14
- package/src/ui/components/OxyProvider.tsx +7 -8
- package/src/ui/components/ProfileButton.tsx +2 -5
- package/src/ui/components/authChooser/AccountsMenuView.tsx +10 -5
- package/src/ui/components/authChooser/primitives.tsx +1 -1
- package/src/ui/components/authChooser/useUsernameAvailability.ts +1 -1
- package/src/ui/components/fileManagement/UploadPreview.tsx +1 -1
- package/src/ui/components/internal/PinInput.tsx +0 -1
- package/src/ui/components/logo/LogoText.tsx +4 -4
- package/src/ui/components/payment/PaymentDetailsStep.tsx +1 -1
- package/src/ui/components/payment/PaymentSummaryStep.tsx +2 -2
- package/src/ui/components/payment/types.ts +24 -24
- package/src/ui/components/styles/shadow.tsx +2 -2
- package/src/ui/context/OxyContext.tsx +46 -35
- package/src/ui/context/__tests__/commitSessionFlow.test.ts +89 -13
- package/src/ui/context/commitSessionFlow.ts +61 -3
- package/src/ui/context/hooks/useAuthOperations.ts +1 -26
- package/src/ui/context/oxyContextTypes.ts +7 -26
- package/src/ui/context/useOxyAccountGraph.ts +4 -4
- package/src/ui/hooks/mutations/mutationFactory.ts +1 -1
- package/src/ui/hooks/mutations/useAccountMutations.ts +1 -1
- package/src/ui/hooks/mutations/useServicesMutations.ts +1 -1
- package/src/ui/hooks/queries/paymentTypes.ts +2 -3
- package/src/ui/hooks/queries/usePaymentQueries.ts +2 -3
- package/src/ui/hooks/queries/userCache.ts +148 -169
- package/src/ui/hooks/useAssets.ts +1 -1
- package/src/ui/hooks/useAsyncAction.ts +3 -3
- package/src/ui/hooks/useAuth.ts +2 -4
- package/src/ui/hooks/useAvatarPicker.ts +1 -1
- package/src/ui/hooks/useOnlineStatus.ts +2 -3
- package/src/ui/hooks/useSessionManagement.ts +2 -0
- package/src/ui/hooks/useSettingToggle.ts +1 -1
- package/src/ui/hooks/useSurfaceHeader.ts +15 -90
- package/src/ui/oauth/__tests__/oauthPopup.test.ts +0 -26
- package/src/ui/oauth/browserAuthTransport.ts +49 -55
- package/src/ui/oauth/legacyRedirectLanes.ts +43 -0
- package/src/ui/oauth/oauthPopup.ts +3 -61
- package/src/ui/screens/AccountMembersScreen.tsx +1 -1
- package/src/ui/screens/AccountSettingsScreen.tsx +5 -5
- package/src/ui/screens/AccountVerificationScreen.tsx +1 -1
- package/src/ui/screens/AppInfoScreen.tsx +1 -1
- package/src/ui/screens/AvatarCropScreen.tsx +1 -1
- package/src/ui/screens/ChangeAvatarScreen.tsx +4 -7
- package/src/ui/screens/ConnectedAppsScreen.tsx +2 -2
- package/src/ui/screens/CreateAccountScreen.tsx +1 -1
- package/src/ui/screens/EditProfileFieldScreen.tsx +1 -1
- package/src/ui/screens/EditProfileScreen.tsx +3 -6
- package/src/ui/screens/FAQScreen.tsx +1 -1
- package/src/ui/screens/FeedbackScreen.tsx +575 -741
- package/src/ui/screens/FileManagementScreen.tsx +1 -1
- package/src/ui/screens/FollowersListScreen.tsx +0 -3
- package/src/ui/screens/FollowingListScreen.tsx +0 -3
- package/src/ui/screens/HelpSupportScreen.tsx +1 -1
- package/src/ui/screens/HistoryViewScreen.tsx +20 -5
- package/src/ui/screens/LanguageSelectorScreen.tsx +1 -1
- package/src/ui/screens/LegalDocumentsScreen.tsx +1 -1
- package/src/ui/screens/ManageAccountScreen.tsx +2 -9
- package/src/ui/screens/PremiumSubscriptionScreen.tsx +4 -4
- package/src/ui/screens/PrivacySettingsScreen.tsx +12 -15
- package/src/ui/screens/ProfileScreen.tsx +6 -24
- package/src/ui/screens/SavesCollectionsScreen.tsx +1 -1
- package/src/ui/screens/UserListScreen.tsx +8 -18
- package/src/ui/screens/WelcomeNewUserScreen.tsx +6 -6
- package/src/ui/screens/fileManagement/PhotoPickerSection.tsx +1 -1
- package/src/ui/screens/fileManagement/hooks/useFileUploadState.ts +5 -14
- package/src/ui/screens/trust/TrustCenterScreen.tsx +2 -2
- package/src/ui/screens/trust/TrustLeaderboardScreen.tsx +5 -6
- package/src/ui/screens/trust/TrustRewardsScreen.tsx +1 -1
- package/src/ui/screens/trust/TrustRulesScreen.tsx +1 -1
- package/src/ui/screens/trust/trustTier.ts +1 -1
- package/src/ui/session/index.ts +0 -1
- package/src/ui/types/navigation.ts +19 -27
- package/src/ui/utils/__tests__/crossOriginRestore.test.ts +143 -0
- package/src/ui/utils/crossOriginRestore.ts +169 -0
- package/src/ui/utils/fileManagement.ts +92 -108
- package/src/ui/utils/oauthReturn.ts +33 -23
- package/src/ui/utils/userUtils.ts +32 -27
- package/android/src/main/java/so/oxy/session/OxyBackgroundSession.kt +0 -184
- package/android/src/main/java/so/oxy/session/OxyBackgroundSessionApi.kt +0 -162
- package/android/src/main/java/so/oxy/session/OxyBackgroundSessionModule.kt +0 -116
- package/android/src/main/java/so/oxy/session/OxyBackgroundSessionStore.kt +0 -179
- package/android/src/main/java/so/oxy/session/OxyBackgroundToken.kt +0 -61
- package/android/src/main/java/so/oxy/storage/OxyEncryptedPrefs.kt +0 -241
- package/lib/commonjs/ui/session/backgroundSession.js +0 -258
- package/lib/commonjs/ui/session/backgroundSession.js.map +0 -1
- package/lib/commonjs/ui/session/useBackgroundSessionSync.js +0 -81
- package/lib/commonjs/ui/session/useBackgroundSessionSync.js.map +0 -1
- package/lib/commonjs/ui/utils/netConnectivity.js +0 -28
- package/lib/commonjs/ui/utils/netConnectivity.js.map +0 -1
- package/lib/module/ui/session/backgroundSession.js +0 -252
- package/lib/module/ui/session/backgroundSession.js.map +0 -1
- package/lib/module/ui/session/useBackgroundSessionSync.js +0 -76
- package/lib/module/ui/session/useBackgroundSessionSync.js.map +0 -1
- package/lib/module/ui/utils/netConnectivity.js +0 -23
- package/lib/module/ui/utils/netConnectivity.js.map +0 -1
- package/lib/typescript/commonjs/ui/session/backgroundSession.d.ts +0 -42
- package/lib/typescript/commonjs/ui/session/backgroundSession.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/session/useBackgroundSessionSync.d.ts +0 -23
- package/lib/typescript/commonjs/ui/session/useBackgroundSessionSync.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/utils/netConnectivity.d.ts +0 -17
- package/lib/typescript/commonjs/ui/utils/netConnectivity.d.ts.map +0 -1
- package/lib/typescript/module/ui/session/backgroundSession.d.ts +0 -42
- package/lib/typescript/module/ui/session/backgroundSession.d.ts.map +0 -1
- package/lib/typescript/module/ui/session/useBackgroundSessionSync.d.ts +0 -23
- package/lib/typescript/module/ui/session/useBackgroundSessionSync.d.ts.map +0 -1
- package/lib/typescript/module/ui/utils/netConnectivity.d.ts +0 -17
- package/lib/typescript/module/ui/utils/netConnectivity.d.ts.map +0 -1
- package/src/ui/boot/__tests__/coldBootNoIdpRedirect.test.ts +0 -215
- package/src/ui/session/__tests__/backgroundSession.test.ts +0 -392
- package/src/ui/session/backgroundSession.ts +0 -313
- package/src/ui/session/useBackgroundSessionSync.ts +0 -92
- package/src/ui/utils/netConnectivity.ts +0 -27
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useCallback } from 'react';
|
|
2
|
-
import type { ApiError, AuthStateStore,
|
|
2
|
+
import type { ApiError, AuthStateStore, SessionClient, User } from '@oxyhq/core';
|
|
3
3
|
import type { AuthState } from '../../stores/authStore';
|
|
4
4
|
import type { ClientSession, SessionLoginResponse } from '@oxyhq/core';
|
|
5
5
|
import { DeviceManager } from '@oxyhq/core';
|
|
@@ -43,15 +43,6 @@ export interface UseAuthOperationsOptions {
|
|
|
43
43
|
logoutStore: () => void;
|
|
44
44
|
setAuthState: (state: Partial<AuthState>) => void;
|
|
45
45
|
logger?: (message: string, error?: unknown) => void;
|
|
46
|
-
/**
|
|
47
|
-
* Identity-bound session (`sessionMode: 'identity'`). When set, a successful
|
|
48
|
-
* key sign-in writes the durable `{publicKey, accountId}` pin so pinned
|
|
49
|
-
* re-mints and projections bind immediately instead of waiting for a second
|
|
50
|
-
* `establishIdentitySession` round-trip.
|
|
51
|
-
*/
|
|
52
|
-
identityBinding?: IdentityBinding;
|
|
53
|
-
/** Refreshes the provider's memoised pinned account id after the pin lands. */
|
|
54
|
-
refreshPinnedAccountId?: () => Promise<string | null>;
|
|
55
46
|
}
|
|
56
47
|
|
|
57
48
|
export interface UseAuthOperationsResult {
|
|
@@ -106,8 +97,6 @@ export const useAuthOperations = ({
|
|
|
106
97
|
logoutStore,
|
|
107
98
|
setAuthState,
|
|
108
99
|
logger,
|
|
109
|
-
identityBinding,
|
|
110
|
-
refreshPinnedAccountId,
|
|
111
100
|
}: UseAuthOperationsOptions): UseAuthOperationsResult => {
|
|
112
101
|
/**
|
|
113
102
|
* Internal function to perform challenge-response sign in.
|
|
@@ -166,18 +155,6 @@ export const useAuthOperations = ({
|
|
|
166
155
|
}
|
|
167
156
|
}
|
|
168
157
|
|
|
169
|
-
if (identityBinding) {
|
|
170
|
-
try {
|
|
171
|
-
await identityBinding.pinStore.save({
|
|
172
|
-
publicKey: publicKey.toLowerCase(),
|
|
173
|
-
accountId: sessionResponse.user.id,
|
|
174
|
-
});
|
|
175
|
-
await refreshPinnedAccountId?.();
|
|
176
|
-
} catch (pinError) {
|
|
177
|
-
logger?.('Failed to persist identity pin after sign-in', pinError);
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
158
|
// Register this recovered account+session into the server-authoritative
|
|
182
159
|
// device-session set AND make it active: `registerAndActivate()` adds via
|
|
183
160
|
// `POST /session/device/add` (identity derived from the bearer
|
|
@@ -260,8 +237,6 @@ export const useAuthOperations = ({
|
|
|
260
237
|
switchSession,
|
|
261
238
|
syncFromClient,
|
|
262
239
|
updateSessions,
|
|
263
|
-
identityBinding,
|
|
264
|
-
refreshPinnedAccountId,
|
|
265
240
|
],
|
|
266
241
|
);
|
|
267
242
|
|
|
@@ -158,9 +158,10 @@ export interface OxyContextProviderProps {
|
|
|
158
158
|
authWebUrl?: string;
|
|
159
159
|
authRedirectUri?: string;
|
|
160
160
|
/**
|
|
161
|
-
* Authorize endpoint override for
|
|
162
|
-
* production Oxy IdP when unset; a
|
|
163
|
-
* own IdP so
|
|
161
|
+
* Authorize endpoint override for silent cross-origin session restore
|
|
162
|
+
* (web cross-app SSO). Defaults to the production Oxy IdP when unset; a
|
|
163
|
+
* local/staging deployment points it at its own IdP so cold boot never
|
|
164
|
+
* bounces the tab to production `auth.oxy.so`.
|
|
164
165
|
*/
|
|
165
166
|
authorizeBaseUrl?: string;
|
|
166
167
|
storageKeyPrefix?: string;
|
|
@@ -173,31 +174,11 @@ export interface OxyContextProviderProps {
|
|
|
173
174
|
sessionMode?: SessionMode;
|
|
174
175
|
/**
|
|
175
176
|
* Transport for WEB third-party sign-in. See `OxyProviderProps.webAuthMode`.
|
|
176
|
-
* @default '
|
|
177
|
+
* @default 'redirect'
|
|
177
178
|
*/
|
|
178
179
|
webAuthMode?: WebAuthMode;
|
|
179
|
-
/**
|
|
180
|
-
|
|
181
|
-
* job) authenticate while the app process is dead and there is no JS runtime.
|
|
182
|
-
*
|
|
183
|
-
* With this on, the SDK provisions a purpose-built background credential
|
|
184
|
-
* whenever the app runs and stores it where `so.oxy.session.OxyBackgroundSession`
|
|
185
|
-
* can read it; Kotlin then exchanges it for a short access token on demand. The
|
|
186
|
-
* app writes no session code — this prop is the whole integration.
|
|
187
|
-
*
|
|
188
|
-
* OFF by default, because a credential that nobody needs is exposure that
|
|
189
|
-
* nobody needs. Turn it on only in an app that actually has background code to
|
|
190
|
-
* authenticate. Android-only today; inert on web and iOS.
|
|
191
|
-
*
|
|
192
|
-
* The credential cannot create a session (only the running app can provision
|
|
193
|
-
* one), cannot rotate or otherwise disturb the app's own device credential, and
|
|
194
|
-
* is re-authorized server-side on every use so it can never outlive a sign-out.
|
|
195
|
-
* It does NOT reduce authority: the token it mints is a full user access token,
|
|
196
|
-
* exactly like the device credential's.
|
|
197
|
-
*
|
|
198
|
-
* @default false
|
|
199
|
-
*/
|
|
200
|
-
backgroundSession?: boolean;
|
|
180
|
+
/** Sync device credentials to auth.oxy.so after interactive sign-in. @default true */
|
|
181
|
+
hubSync?: boolean;
|
|
201
182
|
onAuthStateChange?: (user: User | null) => void;
|
|
202
183
|
onError?: (error: ApiError) => void;
|
|
203
184
|
}
|
|
@@ -22,7 +22,7 @@ interface UseOxyAccountGraphParams {
|
|
|
22
22
|
oxyServices: OxyServices;
|
|
23
23
|
sessionClient: SessionClient;
|
|
24
24
|
syncFromClient: () => Promise<void>;
|
|
25
|
-
commitSession: (input: CommitInput, options: { activate: boolean }) => Promise<void>;
|
|
25
|
+
commitSession: (input: CommitInput, options: { activate: boolean; hubSync?: boolean }) => Promise<void>;
|
|
26
26
|
queryClient: QueryClient;
|
|
27
27
|
accountDialogControllerRef: RefObject<AccountDialogController | null>;
|
|
28
28
|
clearSessionStateRef: RefObject<() => Promise<void>>;
|
|
@@ -110,9 +110,9 @@ export function useOxyAccountGraph({
|
|
|
110
110
|
userId: result.user.id,
|
|
111
111
|
user: result.user,
|
|
112
112
|
},
|
|
113
|
-
// A switch is IN-PLACE
|
|
114
|
-
// `session_state` socket.
|
|
115
|
-
{ activate: true },
|
|
113
|
+
// A switch is IN-PLACE: never run the cross-origin hub-sync full-page
|
|
114
|
+
// redirect. Cross-tab/app propagation rides the `session_state` socket.
|
|
115
|
+
{ activate: true, hubSync: false },
|
|
116
116
|
);
|
|
117
117
|
await runPostAccountSwitchSideEffects();
|
|
118
118
|
},
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
import type { QueryClient, UseMutationOptions } from '@tanstack/react-query';
|
|
13
13
|
import type { User } from '@oxyhq/core';
|
|
14
14
|
import { queryKeys, invalidateAccountQueries, invalidateUserQueries } from '../queries/queryKeys';
|
|
15
|
-
import { toast } from '@oxyhq/bloom
|
|
15
|
+
import { toast } from '@oxyhq/bloom';
|
|
16
16
|
import { useAuthStore } from '../../stores/authStore';
|
|
17
17
|
|
|
18
18
|
/**
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
} from '../queries/queryKeys';
|
|
18
18
|
import { mutationKeys } from './mutationKeys';
|
|
19
19
|
import { useOxy } from '../../context/OxyContext';
|
|
20
|
-
import { toast } from '@oxyhq/bloom
|
|
20
|
+
import { toast } from '@oxyhq/bloom';
|
|
21
21
|
import { refreshAvatarInStore } from '../../utils/avatarUtils';
|
|
22
22
|
import { useAuthStore } from '../../stores/authStore';
|
|
23
23
|
|
|
@@ -3,7 +3,7 @@ import type { ClientSession } from '@oxyhq/core';
|
|
|
3
3
|
import { queryKeys, invalidateSessionQueries } from '../queries/queryKeys';
|
|
4
4
|
import { mutationKeys } from './mutationKeys';
|
|
5
5
|
import { useOxy } from '../../context/OxyContext';
|
|
6
|
-
import { toast } from '@oxyhq/bloom
|
|
6
|
+
import { toast } from '@oxyhq/bloom';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Switch active session
|
|
@@ -7,9 +7,8 @@
|
|
|
7
7
|
* `useUserWalletTransactions`) expose precise types instead of `any`.
|
|
8
8
|
*
|
|
9
9
|
* Source of truth (API):
|
|
10
|
-
* - Subscription: GET /subscription/:userId ->
|
|
11
|
-
*
|
|
12
|
-
* `Subscription` fallback), or `{ plan: 'basic' }` when none.
|
|
10
|
+
* - Subscription: GET /subscription/:userId -> `Subscription` model JSON,
|
|
11
|
+
* or the fallback `{ plan: 'basic' }` when none exists.
|
|
13
12
|
* - Payments: GET /payments/user -> `Payment[]` (sendSuccess).
|
|
14
13
|
* - Wallet: GET /wallet/:userId -> `Wallet` (sendSuccess).
|
|
15
14
|
* - Transactions: GET /wallet/transactions/:userId
|
|
@@ -30,9 +30,8 @@ import type {
|
|
|
30
30
|
* Get the current user's subscription.
|
|
31
31
|
*
|
|
32
32
|
* Wraps `oxyServices.getCurrentUserSubscription()`
|
|
33
|
-
* (`GET /subscription/:userId
|
|
34
|
-
*
|
|
35
|
-
* never subscribed.
|
|
33
|
+
* (`GET /subscription/:userId`). Returns the persisted subscription or the
|
|
34
|
+
* API's `{ plan: 'basic' }` fallback when the user has never subscribed.
|
|
36
35
|
*/
|
|
37
36
|
export const useUserSubscription = (options?: { enabled?: boolean }) => {
|
|
38
37
|
const { oxyServices, isAuthenticated, activeSessionId, user } = useOxy();
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
* It is a cache write only — zero network, one `setQueryData` per key.
|
|
40
40
|
*/
|
|
41
41
|
|
|
42
|
-
import type {
|
|
43
|
-
import type {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
42
|
+
import type { QueryClient } from '@tanstack/react-query';
|
|
43
|
+
import type { UserNameResponse } from '@oxyhq/contracts';
|
|
44
|
+
import { queryKeys } from './queryKeys';
|
|
45
|
+
import { useAuthStore } from '../../stores/authStore';
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
48
|
* A user-shaped object that can be upserted into the cache. Intentionally
|
|
@@ -53,30 +53,30 @@ import { queryKeys } from "./queryKeys";
|
|
|
53
53
|
* pass through untouched (so the upsert never has to know the full DTO shape).
|
|
54
54
|
*/
|
|
55
55
|
export interface CacheableUser {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
56
|
+
id?: string;
|
|
57
|
+
/** Some sources (post/notification actors) carry the id as Mongo `_id`. */
|
|
58
|
+
_id?: string;
|
|
59
|
+
username?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Canonical structured name (`UserNameResponse`) OR a plain display string on
|
|
62
|
+
* the looser actor objects. Normalized to the object shape on write.
|
|
63
|
+
*/
|
|
64
|
+
name?: string | UserNameResponse;
|
|
65
|
+
/** Avatar file id. `null`/`''` are treated as "no avatar" (never degrade). */
|
|
66
|
+
avatar?: string | null;
|
|
67
|
+
/** Social counts. A partial `_count` never replaces a fuller one. */
|
|
68
|
+
_count?: { followers?: number; following?: number } | null;
|
|
69
|
+
/**
|
|
70
|
+
* Viewer-relative follow relationship. Present ONLY on an authenticated
|
|
71
|
+
* single-profile fetch; `null`/absent for anon/self/bulk/feed. Never stripped
|
|
72
|
+
* from an existing entry by a source that lacks it.
|
|
73
|
+
*/
|
|
74
|
+
relationship?: { isFollowing?: boolean; followsYou?: boolean } | null;
|
|
75
|
+
[key: string]: unknown;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
/** The degraded display-name sentinel (ghost-author rule). */
|
|
79
|
-
const DEGRADED_DISPLAY_NAME =
|
|
79
|
+
const DEGRADED_DISPLAY_NAME = 'Unknown user';
|
|
80
80
|
|
|
81
81
|
/** A cache entry always carries a resolved string `id`. */
|
|
82
82
|
type CachedUser = CacheableUser & { id: string; name?: UserNameResponse };
|
|
@@ -88,34 +88,28 @@ type CachedUser = CacheableUser & { id: string; name?: UserNameResponse };
|
|
|
88
88
|
* meaningful (a real `verified: false` or `_count.followers: 0`).
|
|
89
89
|
*/
|
|
90
90
|
function isMeaningful(value: unknown): boolean {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
91
|
+
if (value === undefined || value === null) return false;
|
|
92
|
+
if (typeof value === 'string') return value.trim() !== '';
|
|
93
|
+
return true;
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
/** A display name is meaningful only when non-empty AND not the degraded sentinel. */
|
|
97
97
|
function isMeaningfulDisplayName(value: unknown): value is string {
|
|
98
|
-
|
|
99
|
-
typeof value === "string" &&
|
|
100
|
-
value.trim() !== "" &&
|
|
101
|
-
value !== DEGRADED_DISPLAY_NAME
|
|
102
|
-
);
|
|
98
|
+
return typeof value === 'string' && value.trim() !== '' && value !== DEGRADED_DISPLAY_NAME;
|
|
103
99
|
}
|
|
104
100
|
|
|
105
101
|
function isPlainObject(value: unknown): value is Record<string, unknown> {
|
|
106
|
-
|
|
102
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
107
103
|
}
|
|
108
104
|
|
|
109
105
|
/** Normalize the polymorphic `name` (string | object | nullish) to the canonical object shape. */
|
|
110
|
-
function normalizeName(
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
}
|
|
118
|
-
return name;
|
|
106
|
+
function normalizeName(name: CacheableUser['name']): UserNameResponse | undefined {
|
|
107
|
+
if (name === undefined || name === null) return undefined;
|
|
108
|
+
if (typeof name === 'string') {
|
|
109
|
+
const trimmed = name.trim();
|
|
110
|
+
return trimmed ? { displayName: trimmed } : undefined;
|
|
111
|
+
}
|
|
112
|
+
return name;
|
|
119
113
|
}
|
|
120
114
|
|
|
121
115
|
/**
|
|
@@ -125,12 +119,12 @@ function normalizeName(
|
|
|
125
119
|
* object so the cache never holds a bare-string name).
|
|
126
120
|
*/
|
|
127
121
|
function toCachedUser(user: CacheableUser, fallbackId: string): CachedUser {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
122
|
+
const { name: rawName, ...rest } = user;
|
|
123
|
+
const id = String(user.id ?? user._id ?? fallbackId);
|
|
124
|
+
const name = normalizeName(rawName);
|
|
125
|
+
const normalized: CachedUser = { ...rest, id };
|
|
126
|
+
if (name !== undefined) normalized.name = name;
|
|
127
|
+
return normalized;
|
|
134
128
|
}
|
|
135
129
|
|
|
136
130
|
/**
|
|
@@ -138,43 +132,39 @@ function toCachedUser(user: CacheableUser, fallbackId: string): CachedUser {
|
|
|
138
132
|
* when no id can be resolved (nothing to key on).
|
|
139
133
|
*/
|
|
140
134
|
function normalizeIncoming(user: CacheableUser): CachedUser | null {
|
|
141
|
-
|
|
142
|
-
|
|
135
|
+
const cached = toCachedUser(user, '');
|
|
136
|
+
return cached.id ? cached : null;
|
|
143
137
|
}
|
|
144
138
|
|
|
145
139
|
/** Merge two `name` objects field-by-field, with anti-degradation on `displayName`. */
|
|
146
140
|
function mergeName(
|
|
147
|
-
|
|
148
|
-
|
|
141
|
+
existing: UserNameResponse | undefined,
|
|
142
|
+
incoming: UserNameResponse | undefined,
|
|
149
143
|
): UserNameResponse | undefined {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
144
|
+
if (incoming === undefined) return existing;
|
|
145
|
+
if (existing === undefined) return incoming;
|
|
146
|
+
const merged: UserNameResponse = { ...existing };
|
|
147
|
+
for (const [key, value] of Object.entries(incoming)) {
|
|
148
|
+
if (key === 'displayName') continue;
|
|
149
|
+
if (isMeaningful(value)) merged[key] = value;
|
|
150
|
+
}
|
|
151
|
+
// Never let an empty / `'Unknown user'` displayName overwrite a real one.
|
|
152
|
+
if (isMeaningfulDisplayName(incoming.displayName)) {
|
|
153
|
+
merged.displayName = incoming.displayName;
|
|
154
|
+
}
|
|
155
|
+
return merged;
|
|
162
156
|
}
|
|
163
157
|
|
|
164
158
|
/** Merge `_count` field-by-field so a partial count never replaces a fuller one. */
|
|
165
159
|
function mergeCount(
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
): CacheableUser[
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
merged.followers = incoming.followers;
|
|
175
|
-
if (typeof incoming.following === "number")
|
|
176
|
-
merged.following = incoming.following;
|
|
177
|
-
return merged;
|
|
160
|
+
existing: CacheableUser['_count'],
|
|
161
|
+
incoming: CacheableUser['_count'],
|
|
162
|
+
): CacheableUser['_count'] {
|
|
163
|
+
if (!isPlainObject(incoming)) return existing;
|
|
164
|
+
const merged: { followers?: number; following?: number } = { ...(isPlainObject(existing) ? existing : {}) };
|
|
165
|
+
if (typeof incoming.followers === 'number') merged.followers = incoming.followers;
|
|
166
|
+
if (typeof incoming.following === 'number') merged.following = incoming.following;
|
|
167
|
+
return merged;
|
|
178
168
|
}
|
|
179
169
|
|
|
180
170
|
/**
|
|
@@ -182,18 +172,16 @@ function mergeCount(
|
|
|
182
172
|
* or an anon/self/bulk `null`) must NEVER strip an existing viewer relationship.
|
|
183
173
|
*/
|
|
184
174
|
function mergeRelationship(
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
): CacheableUser[
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
merged.followsYou = incoming.followsYou;
|
|
196
|
-
return merged;
|
|
175
|
+
existing: CacheableUser['relationship'],
|
|
176
|
+
incoming: CacheableUser['relationship'],
|
|
177
|
+
): CacheableUser['relationship'] {
|
|
178
|
+
if (!isPlainObject(incoming)) return existing;
|
|
179
|
+
const merged: { isFollowing?: boolean; followsYou?: boolean } = {
|
|
180
|
+
...(isPlainObject(existing) ? existing : {}),
|
|
181
|
+
};
|
|
182
|
+
if (typeof incoming.isFollowing === 'boolean') merged.isFollowing = incoming.isFollowing;
|
|
183
|
+
if (typeof incoming.followsYou === 'boolean') merged.followsYou = incoming.followsYou;
|
|
184
|
+
return merged;
|
|
197
185
|
}
|
|
198
186
|
|
|
199
187
|
/**
|
|
@@ -205,63 +193,54 @@ function mergeRelationship(
|
|
|
205
193
|
* only the by-username key carries it (`useUserByUsername`).
|
|
206
194
|
*/
|
|
207
195
|
function mergeUsers(
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
196
|
+
existing: CachedUser,
|
|
197
|
+
incoming: CachedUser,
|
|
198
|
+
options?: { includeRelationship?: boolean },
|
|
211
199
|
): CachedUser {
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
merged.relationship = undefined;
|
|
234
|
-
}
|
|
235
|
-
return merged;
|
|
200
|
+
const includeRelationship = options?.includeRelationship ?? true;
|
|
201
|
+
const merged: CachedUser = { ...existing };
|
|
202
|
+
for (const [key, value] of Object.entries(incoming)) {
|
|
203
|
+
if (key === 'name' || key === '_count' || key === 'relationship') continue;
|
|
204
|
+
if (key === 'id') {
|
|
205
|
+
merged.id = incoming.id;
|
|
206
|
+
continue;
|
|
207
|
+
}
|
|
208
|
+
if (isMeaningful(value)) merged[key] = value;
|
|
209
|
+
}
|
|
210
|
+
const name = mergeName(existing.name, incoming.name);
|
|
211
|
+
if (name !== undefined) merged.name = name;
|
|
212
|
+
const count = mergeCount(existing._count, incoming._count);
|
|
213
|
+
if (count !== undefined) merged._count = count;
|
|
214
|
+
if (includeRelationship) {
|
|
215
|
+
const relationship = mergeRelationship(existing.relationship, incoming.relationship);
|
|
216
|
+
if (relationship !== undefined) merged.relationship = relationship;
|
|
217
|
+
} else {
|
|
218
|
+
delete merged.relationship;
|
|
219
|
+
}
|
|
220
|
+
return merged;
|
|
236
221
|
}
|
|
237
222
|
|
|
238
223
|
/** Merge-upsert a normalized user into one cache key (see module docs for semantics). */
|
|
239
224
|
function upsertOneKey(
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
225
|
+
queryClient: QueryClient,
|
|
226
|
+
key: readonly unknown[],
|
|
227
|
+
incoming: CachedUser,
|
|
228
|
+
options: { includeRelationship: boolean },
|
|
244
229
|
): void {
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
mergeOpts,
|
|
260
|
-
);
|
|
261
|
-
const dataUpdatedAt = queryClient.getQueryState(key)?.dataUpdatedAt ?? 0;
|
|
262
|
-
queryClient.setQueryData<CachedUser>(key, merged, {
|
|
263
|
-
updatedAt: dataUpdatedAt,
|
|
264
|
-
});
|
|
230
|
+
const mergeOpts = { includeRelationship: options.includeRelationship };
|
|
231
|
+
const existing = queryClient.getQueryData<CacheableUser>(key);
|
|
232
|
+
if (existing === undefined) {
|
|
233
|
+
// Cold slot: seed the full incoming object, STALE, so react-query refetches
|
|
234
|
+
// the full authoritative profile (relationship, counts, createdAt, …).
|
|
235
|
+
const seeded = mergeUsers({ id: incoming.id }, incoming, mergeOpts);
|
|
236
|
+
queryClient.setQueryData<CachedUser>(key, seeded, { updatedAt: 0 });
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
// Existing entry: merge and leave its freshness lifecycle untouched. The
|
|
240
|
+
// existing entry is keyed by `incoming.id`, so use it as the fallback id.
|
|
241
|
+
const merged = mergeUsers(toCachedUser(existing, incoming.id), incoming, mergeOpts);
|
|
242
|
+
const dataUpdatedAt = queryClient.getQueryState(key)?.dataUpdatedAt ?? 0;
|
|
243
|
+
queryClient.setQueryData<CachedUser>(key, merged, { updatedAt: dataUpdatedAt });
|
|
265
244
|
}
|
|
266
245
|
|
|
267
246
|
/**
|
|
@@ -272,7 +251,7 @@ function upsertOneKey(
|
|
|
272
251
|
* empty string is honoured (anonymous scope).
|
|
273
252
|
*/
|
|
274
253
|
function resolveViewerId(viewerId?: string): string {
|
|
275
|
-
|
|
254
|
+
return viewerId ?? useAuthStore.getState().user?.id ?? '';
|
|
276
255
|
}
|
|
277
256
|
|
|
278
257
|
/**
|
|
@@ -286,29 +265,29 @@ function resolveViewerId(viewerId?: string): string {
|
|
|
286
265
|
* the current auth-store user id.
|
|
287
266
|
*/
|
|
288
267
|
export function upsertCachedUser(
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
268
|
+
queryClient: QueryClient,
|
|
269
|
+
user: CacheableUser,
|
|
270
|
+
viewerId?: string,
|
|
292
271
|
): void {
|
|
293
|
-
|
|
294
|
-
|
|
272
|
+
const incoming = normalizeIncoming(user);
|
|
273
|
+
if (!incoming) return;
|
|
295
274
|
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
275
|
+
// By-id identity entry (read by `useUserById`). Not viewer-scoped — never store
|
|
276
|
+
// the viewer-relative `relationship` here or one viewer's follow state leaks
|
|
277
|
+
// into every other viewer's by-id cache entry.
|
|
278
|
+
upsertOneKey(queryClient, queryKeys.users.detail(incoming.id), incoming, {
|
|
279
|
+
includeRelationship: false,
|
|
280
|
+
});
|
|
302
281
|
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
282
|
+
const username = incoming.username;
|
|
283
|
+
if (typeof username === 'string' && username.trim() !== '') {
|
|
284
|
+
// By-username entry (read by `useUserByUsername`). Viewer-scoped because the
|
|
285
|
+
// authenticated single-profile fetch embeds the viewer `relationship`. Build
|
|
286
|
+
// the key through the SAME helper the hook uses so username normalization
|
|
287
|
+
// (`trim().toLowerCase()`) matches byte-for-byte.
|
|
288
|
+
const key = queryKeys.users.byUsername(username, resolveViewerId(viewerId));
|
|
289
|
+
upsertOneKey(queryClient, key, incoming, { includeRelationship: true });
|
|
290
|
+
}
|
|
312
291
|
}
|
|
313
292
|
|
|
314
293
|
/**
|
|
@@ -317,13 +296,13 @@ export function upsertCachedUser(
|
|
|
317
296
|
* appears twice merges both slices into the single cache entry.
|
|
318
297
|
*/
|
|
319
298
|
export function upsertCachedUsers(
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
299
|
+
queryClient: QueryClient,
|
|
300
|
+
users: readonly CacheableUser[] | null | undefined,
|
|
301
|
+
viewerId?: string,
|
|
323
302
|
): void {
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
303
|
+
if (!Array.isArray(users) || users.length === 0) return;
|
|
304
|
+
const resolvedViewerId = resolveViewerId(viewerId);
|
|
305
|
+
for (const user of users) {
|
|
306
|
+
if (user) upsertCachedUser(queryClient, user, resolvedViewerId);
|
|
307
|
+
}
|
|
329
308
|
}
|
|
@@ -48,7 +48,7 @@ export const useAssets = () => {
|
|
|
48
48
|
// Upload asset with progress tracking
|
|
49
49
|
const upload = useCallback(async (
|
|
50
50
|
file: File,
|
|
51
|
-
metadata?: Record<string,
|
|
51
|
+
metadata?: Record<string, any>
|
|
52
52
|
): Promise<Asset | null> => {
|
|
53
53
|
if (!oxyInstance) {
|
|
54
54
|
throw new Error('OxyServices instance not configured. Call setOxyAssetInstance first.');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useState, useCallback } from 'react';
|
|
2
|
-
import { toast } from '@oxyhq/bloom
|
|
2
|
+
import { toast } from '@oxyhq/bloom';
|
|
3
3
|
|
|
4
4
|
interface UseAsyncActionOptions<T> {
|
|
5
5
|
/** Function to execute */
|
|
@@ -7,11 +7,11 @@ interface UseAsyncActionOptions<T> {
|
|
|
7
7
|
/** Success message to display */
|
|
8
8
|
successMessage?: string;
|
|
9
9
|
/** Error message to display (or function to get message from error) */
|
|
10
|
-
errorMessage?: string | ((error:
|
|
10
|
+
errorMessage?: string | ((error: any) => string);
|
|
11
11
|
/** Callback on success */
|
|
12
12
|
onSuccess?: (result: T) => void;
|
|
13
13
|
/** Callback on error */
|
|
14
|
-
onError?: (error:
|
|
14
|
+
onError?: (error: any) => void;
|
|
15
15
|
/** Show loading toast */
|
|
16
16
|
showLoadingToast?: boolean;
|
|
17
17
|
/** Loading message */
|
package/src/ui/hooks/useAuth.ts
CHANGED
|
@@ -17,10 +17,8 @@
|
|
|
17
17
|
* }
|
|
18
18
|
* ```
|
|
19
19
|
*
|
|
20
|
-
*
|
|
21
|
-
* - Web:
|
|
22
|
-
* origin stays signed out until the user presses "Continue with Oxy". There is
|
|
23
|
-
* no cross-origin silent SSO: the SDK never navigates the tab on its own.
|
|
20
|
+
* Cross-domain session (zero cookies):
|
|
21
|
+
* - Web: silent OAuth (`prompt=none`) on cold boot; hub-ticket sync to auth.oxy.so after sign-in
|
|
24
22
|
* - Native: shared Keychain / app-group identity (Commons)
|
|
25
23
|
* - Realtime sync: Socket.IO `session_state` on `device:<deviceId>` once authenticated
|
|
26
24
|
* - Manual sign-in: signIn() opens the in-app account dialog (web + native)
|