@oxyhq/services 22.13.0 → 23.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/lib/commonjs/index.js +74 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/notifications/deviceNotifications.js +424 -0
- package/lib/commonjs/notifications/deviceNotifications.js.map +1 -0
- package/lib/commonjs/ui/boot/runProviderColdBoot.js +20 -64
- package/lib/commonjs/ui/boot/runProviderColdBoot.js.map +1 -1
- package/lib/commonjs/ui/components/AvatarCameraBadge.js +3 -2
- package/lib/commonjs/ui/components/AvatarCameraBadge.js.map +1 -1
- package/lib/commonjs/ui/components/OxyAuthChooser.js +5 -4
- package/lib/commonjs/ui/components/OxyAuthChooser.js.map +1 -1
- package/lib/commonjs/ui/components/OxyProvider.js +5 -6
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/components/OxySignInRequestSurface.js +147 -0
- package/lib/commonjs/ui/components/OxySignInRequestSurface.js.map +1 -0
- package/lib/commonjs/ui/components/ProfileButton.js +4 -3
- package/lib/commonjs/ui/components/ProfileButton.js.map +1 -1
- package/lib/commonjs/ui/components/SettingsIcon.js +3 -2
- package/lib/commonjs/ui/components/SettingsIcon.js.map +1 -1
- package/lib/commonjs/ui/components/authChooser/AccountsMenuView.js +7 -7
- package/lib/commonjs/ui/components/authChooser/AccountsMenuView.js.map +1 -1
- package/lib/commonjs/ui/components/authChooser/SignInEntryView.js.map +1 -1
- package/lib/commonjs/ui/components/authChooser/SignInRequestView.js +65 -103
- package/lib/commonjs/ui/components/authChooser/SignInRequestView.js.map +1 -1
- package/lib/commonjs/ui/components/authChooser/TroubleDisclosure.js +0 -2
- package/lib/commonjs/ui/components/authChooser/TroubleDisclosure.js.map +1 -1
- package/lib/commonjs/ui/components/authChooser/primitives.js +5 -4
- package/lib/commonjs/ui/components/authChooser/primitives.js.map +1 -1
- package/lib/commonjs/ui/components/authChooser/requestSurfaces.js +14 -10
- package/lib/commonjs/ui/components/authChooser/requestSurfaces.js.map +1 -1
- package/lib/commonjs/ui/components/authChooser/types.js +11 -0
- package/lib/commonjs/ui/components/authChooser/types.js.map +1 -1
- package/lib/commonjs/ui/components/fileManagement/AnimatedButton.js +3 -2
- package/lib/commonjs/ui/components/fileManagement/AnimatedButton.js.map +1 -1
- package/lib/commonjs/ui/components/fileManagement/FileDetailsModal.js +3 -2
- package/lib/commonjs/ui/components/fileManagement/FileDetailsModal.js.map +1 -1
- package/lib/commonjs/ui/components/fileManagement/FileViewer.js +15 -14
- package/lib/commonjs/ui/components/fileManagement/FileViewer.js.map +1 -1
- package/lib/commonjs/ui/components/fileManagement/UploadPreview.js +6 -5
- package/lib/commonjs/ui/components/fileManagement/UploadPreview.js.map +1 -1
- package/lib/commonjs/ui/components/modals/DeleteAccountModal.js +3 -2
- package/lib/commonjs/ui/components/modals/DeleteAccountModal.js.map +1 -1
- package/lib/commonjs/ui/components/payment/PaymentDetailsStep.js +6 -6
- package/lib/commonjs/ui/components/payment/PaymentDetailsStep.js.map +1 -1
- package/lib/commonjs/ui/components/payment/PaymentMethodStep.js +5 -5
- package/lib/commonjs/ui/components/payment/PaymentMethodStep.js.map +1 -1
- package/lib/commonjs/ui/components/payment/PaymentReviewStep.js +10 -9
- package/lib/commonjs/ui/components/payment/PaymentReviewStep.js.map +1 -1
- package/lib/commonjs/ui/components/payment/PaymentSuccessStep.js +4 -3
- package/lib/commonjs/ui/components/payment/PaymentSuccessStep.js.map +1 -1
- package/lib/commonjs/ui/components/payment/PaymentSummaryStep.js +6 -5
- 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 +14 -45
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/context/commitSessionFlow.js +0 -43
- package/lib/commonjs/ui/context/commitSessionFlow.js.map +1 -1
- package/lib/commonjs/ui/context/useOxyAccountGraph.js +3 -4
- package/lib/commonjs/ui/context/useOxyAccountGraph.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/useAuth.js +4 -2
- package/lib/commonjs/ui/hooks/useAuth.js.map +1 -1
- package/lib/commonjs/ui/hooks/useOnlineStatus.js +3 -2
- package/lib/commonjs/ui/hooks/useOnlineStatus.js.map +1 -1
- package/lib/commonjs/ui/hooks/useSessionManagement.js +0 -2
- package/lib/commonjs/ui/hooks/useSessionManagement.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountMembersScreen.js +4 -3
- package/lib/commonjs/ui/screens/AccountMembersScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ConnectedAppsScreen.js +1 -1
- package/lib/commonjs/ui/screens/ConnectedAppsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/CreateAccountScreen.js +7 -6
- package/lib/commonjs/ui/screens/CreateAccountScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js +4 -3
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FAQScreen.js +3 -2
- package/lib/commonjs/ui/screens/FAQScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FeedbackScreen.js +96 -96
- package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FileManagementScreen.js +19 -18
- package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HistoryViewScreen.js +4 -29
- package/lib/commonjs/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js +4 -3
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ManageAccountScreen.js +2 -2
- package/lib/commonjs/ui/screens/ManageAccountScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js +3 -3
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +10 -9
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js +1 -0
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ProfileScreen.js +12 -13
- package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/UserListScreen.js +4 -4
- package/lib/commonjs/ui/screens/UserListScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js +6 -6
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/fileManagement/FileLibraryError.js +4 -3
- package/lib/commonjs/ui/screens/fileManagement/FileLibraryError.js.map +1 -1
- package/lib/commonjs/ui/screens/fileManagement/FileListSection.js +4 -3
- package/lib/commonjs/ui/screens/fileManagement/FileListSection.js.map +1 -1
- package/lib/commonjs/ui/screens/fileManagement/PhotoPickerSection.js +5 -7
- package/lib/commonjs/ui/screens/fileManagement/PhotoPickerSection.js.map +1 -1
- package/lib/commonjs/ui/screens/fileManagement/UploadBar.js +3 -2
- package/lib/commonjs/ui/screens/fileManagement/UploadBar.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js +3 -2
- package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustLeaderboardScreen.js +5 -4
- package/lib/commonjs/ui/screens/trust/TrustLeaderboardScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustRewardsScreen.js +4 -3
- package/lib/commonjs/ui/screens/trust/TrustRewardsScreen.js.map +1 -1
- package/lib/commonjs/ui/utils/fileManagement.js +24 -24
- package/lib/commonjs/ui/utils/fileManagement.js.map +1 -1
- package/lib/commonjs/ui/utils/netConnectivity.js +28 -0
- package/lib/commonjs/ui/utils/netConnectivity.js.map +1 -0
- package/lib/commonjs/ui/utils/oauthReturn.js +15 -28
- package/lib/commonjs/ui/utils/oauthReturn.js.map +1 -1
- package/lib/module/index.js +18 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/notifications/deviceNotifications.js +414 -0
- package/lib/module/notifications/deviceNotifications.js.map +1 -0
- package/lib/module/ui/boot/runProviderColdBoot.js +21 -65
- package/lib/module/ui/boot/runProviderColdBoot.js.map +1 -1
- package/lib/module/ui/components/AvatarCameraBadge.js +1 -1
- package/lib/module/ui/components/AvatarCameraBadge.js.map +1 -1
- package/lib/module/ui/components/OxyAuthChooser.js +5 -4
- package/lib/module/ui/components/OxyAuthChooser.js.map +1 -1
- package/lib/module/ui/components/OxyProvider.js +5 -6
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/components/OxySignInRequestSurface.js +141 -0
- package/lib/module/ui/components/OxySignInRequestSurface.js.map +1 -0
- package/lib/module/ui/components/ProfileButton.js +1 -1
- package/lib/module/ui/components/ProfileButton.js.map +1 -1
- package/lib/module/ui/components/SettingsIcon.js +1 -1
- package/lib/module/ui/components/SettingsIcon.js.map +1 -1
- package/lib/module/ui/components/authChooser/AccountsMenuView.js +1 -1
- package/lib/module/ui/components/authChooser/AccountsMenuView.js.map +1 -1
- package/lib/module/ui/components/authChooser/SignInEntryView.js.map +1 -1
- package/lib/module/ui/components/authChooser/SignInRequestView.js +66 -104
- package/lib/module/ui/components/authChooser/SignInRequestView.js.map +1 -1
- package/lib/module/ui/components/authChooser/TroubleDisclosure.js +0 -2
- package/lib/module/ui/components/authChooser/TroubleDisclosure.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/requestSurfaces.js +13 -9
- package/lib/module/ui/components/authChooser/requestSurfaces.js.map +1 -1
- package/lib/module/ui/components/authChooser/types.js +11 -0
- package/lib/module/ui/components/authChooser/types.js.map +1 -1
- package/lib/module/ui/components/fileManagement/AnimatedButton.js +1 -1
- package/lib/module/ui/components/fileManagement/AnimatedButton.js.map +1 -1
- package/lib/module/ui/components/fileManagement/FileDetailsModal.js +1 -1
- package/lib/module/ui/components/fileManagement/FileDetailsModal.js.map +1 -1
- package/lib/module/ui/components/fileManagement/FileViewer.js +1 -1
- package/lib/module/ui/components/fileManagement/FileViewer.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/modals/DeleteAccountModal.js +1 -1
- package/lib/module/ui/components/modals/DeleteAccountModal.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/PaymentMethodStep.js +1 -1
- package/lib/module/ui/components/payment/PaymentMethodStep.js.map +1 -1
- package/lib/module/ui/components/payment/PaymentReviewStep.js +1 -1
- package/lib/module/ui/components/payment/PaymentReviewStep.js.map +1 -1
- package/lib/module/ui/components/payment/PaymentSuccessStep.js +1 -1
- package/lib/module/ui/components/payment/PaymentSuccessStep.js.map +1 -1
- package/lib/module/ui/components/payment/PaymentSummaryStep.js +1 -1
- 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 +16 -47
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/context/commitSessionFlow.js +0 -42
- package/lib/module/ui/context/commitSessionFlow.js.map +1 -1
- package/lib/module/ui/context/useOxyAccountGraph.js +3 -4
- package/lib/module/ui/context/useOxyAccountGraph.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/useAuth.js +4 -2
- package/lib/module/ui/hooks/useAuth.js.map +1 -1
- package/lib/module/ui/hooks/useOnlineStatus.js +3 -2
- package/lib/module/ui/hooks/useOnlineStatus.js.map +1 -1
- package/lib/module/ui/hooks/useSessionManagement.js +0 -2
- package/lib/module/ui/hooks/useSessionManagement.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/ConnectedAppsScreen.js +1 -1
- 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/FAQScreen.js +1 -1
- package/lib/module/ui/screens/FAQScreen.js.map +1 -1
- package/lib/module/ui/screens/FeedbackScreen.js +91 -90
- package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/module/ui/screens/FileManagementScreen.js +2 -1
- package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/HistoryViewScreen.js +4 -29
- 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/ManageAccountScreen.js +1 -1
- package/lib/module/ui/screens/ManageAccountScreen.js.map +1 -1
- package/lib/module/ui/screens/PaymentGatewayScreen.js +1 -1
- package/lib/module/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js +2 -2
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/module/ui/screens/PrivacySettingsScreen.js +1 -0
- package/lib/module/ui/screens/PrivacySettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/ProfileScreen.js +4 -5
- package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/module/ui/screens/UserListScreen.js +3 -3
- package/lib/module/ui/screens/UserListScreen.js.map +1 -1
- package/lib/module/ui/screens/WelcomeNewUserScreen.js +5 -6
- package/lib/module/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/module/ui/screens/fileManagement/FileLibraryError.js +1 -1
- package/lib/module/ui/screens/fileManagement/FileLibraryError.js.map +1 -1
- package/lib/module/ui/screens/fileManagement/FileListSection.js +1 -1
- package/lib/module/ui/screens/fileManagement/FileListSection.js.map +1 -1
- package/lib/module/ui/screens/fileManagement/PhotoPickerSection.js +3 -5
- package/lib/module/ui/screens/fileManagement/PhotoPickerSection.js.map +1 -1
- package/lib/module/ui/screens/fileManagement/UploadBar.js +1 -1
- package/lib/module/ui/screens/fileManagement/UploadBar.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 +3 -3
- 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/utils/fileManagement.js +25 -25
- package/lib/module/ui/utils/fileManagement.js.map +1 -1
- package/lib/module/ui/utils/netConnectivity.js +23 -0
- package/lib/module/ui/utils/netConnectivity.js.map +1 -0
- package/lib/module/ui/utils/oauthReturn.js +15 -27
- package/lib/module/ui/utils/oauthReturn.js.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +5 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/notifications/deviceNotifications.d.ts +173 -0
- package/lib/typescript/commonjs/notifications/deviceNotifications.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/boot/runProviderColdBoot.d.ts +11 -30
- package/lib/typescript/commonjs/ui/boot/runProviderColdBoot.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts +5 -3
- 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/OxySignInRequestSurface.d.ts +108 -0
- package/lib/typescript/commonjs/ui/components/OxySignInRequestSurface.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/SettingsIcon.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/SettingsIcon.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/authChooser/SignInEntryView.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/authChooser/SignInRequestView.d.ts +18 -18
- package/lib/typescript/commonjs/ui/components/authChooser/SignInRequestView.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/authChooser/TroubleDisclosure.d.ts +3 -10
- package/lib/typescript/commonjs/ui/components/authChooser/TroubleDisclosure.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/authChooser/requestSurfaces.d.ts +8 -4
- package/lib/typescript/commonjs/ui/components/authChooser/requestSurfaces.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/authChooser/types.d.ts +18 -0
- package/lib/typescript/commonjs/ui/components/authChooser/types.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 +0 -40
- package/lib/typescript/commonjs/ui/context/commitSessionFlow.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/oxyContextTypes.d.ts +4 -7
- package/lib/typescript/commonjs/ui/context/oxyContextTypes.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/useOxyAccountGraph.d.ts +0 -1
- package/lib/typescript/commonjs/ui/context/useOxyAccountGraph.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 +4 -2
- package/lib/typescript/commonjs/ui/hooks/useAuth.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useOnlineStatus.d.ts +3 -2
- 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/screens/FeedbackScreen.d.ts +2 -2
- package/lib/typescript/commonjs/ui/screens/FeedbackScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/FileManagementScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/HistoryViewScreen.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/WelcomeNewUserScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/fileManagement/PhotoPickerSection.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/trust/TrustLeaderboardScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/types/navigation.d.ts +20 -19
- package/lib/typescript/commonjs/ui/types/navigation.d.ts.map +1 -1
- 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/netConnectivity.d.ts +17 -0
- package/lib/typescript/commonjs/ui/utils/netConnectivity.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/utils/oauthReturn.d.ts +15 -12
- package/lib/typescript/commonjs/ui/utils/oauthReturn.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +5 -0
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/notifications/deviceNotifications.d.ts +173 -0
- package/lib/typescript/module/notifications/deviceNotifications.d.ts.map +1 -0
- package/lib/typescript/module/ui/boot/runProviderColdBoot.d.ts +11 -30
- package/lib/typescript/module/ui/boot/runProviderColdBoot.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts +5 -3
- 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/OxySignInRequestSurface.d.ts +108 -0
- package/lib/typescript/module/ui/components/OxySignInRequestSurface.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/SettingsIcon.d.ts +1 -1
- package/lib/typescript/module/ui/components/SettingsIcon.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/authChooser/SignInEntryView.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/authChooser/SignInRequestView.d.ts +18 -18
- package/lib/typescript/module/ui/components/authChooser/SignInRequestView.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/authChooser/TroubleDisclosure.d.ts +3 -10
- package/lib/typescript/module/ui/components/authChooser/TroubleDisclosure.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/authChooser/requestSurfaces.d.ts +8 -4
- package/lib/typescript/module/ui/components/authChooser/requestSurfaces.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/authChooser/types.d.ts +18 -0
- package/lib/typescript/module/ui/components/authChooser/types.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 +0 -40
- package/lib/typescript/module/ui/context/commitSessionFlow.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/oxyContextTypes.d.ts +4 -7
- package/lib/typescript/module/ui/context/oxyContextTypes.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/useOxyAccountGraph.d.ts +0 -1
- package/lib/typescript/module/ui/context/useOxyAccountGraph.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 +4 -2
- package/lib/typescript/module/ui/hooks/useAuth.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useOnlineStatus.d.ts +3 -2
- 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/screens/FeedbackScreen.d.ts +2 -2
- package/lib/typescript/module/ui/screens/FeedbackScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/FileManagementScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/HistoryViewScreen.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/WelcomeNewUserScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/fileManagement/PhotoPickerSection.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustLeaderboardScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/types/navigation.d.ts +20 -19
- package/lib/typescript/module/ui/types/navigation.d.ts.map +1 -1
- 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/netConnectivity.d.ts +17 -0
- package/lib/typescript/module/ui/utils/netConnectivity.d.ts.map +1 -0
- package/lib/typescript/module/ui/utils/oauthReturn.d.ts +15 -12
- package/lib/typescript/module/ui/utils/oauthReturn.d.ts.map +1 -1
- package/package.json +18 -8
- package/src/index.ts +32 -0
- package/src/notifications/deviceNotifications.ts +458 -0
- package/src/ui/boot/__tests__/coldBootNoIdpRedirect.test.ts +215 -0
- package/src/ui/boot/runProviderColdBoot.ts +24 -101
- package/src/ui/components/AvatarCameraBadge.tsx +1 -1
- package/src/ui/components/OxyAuthChooser.tsx +5 -4
- package/src/ui/components/OxyProvider.tsx +5 -6
- package/src/ui/components/OxySignInRequestSurface.tsx +202 -0
- package/src/ui/components/ProfileButton.tsx +1 -1
- package/src/ui/components/SettingsIcon.tsx +1 -1
- package/src/ui/components/authChooser/AccountsMenuView.tsx +1 -1
- package/src/ui/components/authChooser/SignInEntryView.tsx +9 -3
- package/src/ui/components/authChooser/SignInRequestView.tsx +78 -111
- package/src/ui/components/authChooser/TroubleDisclosure.tsx +3 -11
- package/src/ui/components/authChooser/primitives.tsx +1 -1
- package/src/ui/components/authChooser/requestSurfaces.tsx +15 -11
- package/src/ui/components/authChooser/types.ts +19 -0
- package/src/ui/components/fileManagement/AnimatedButton.tsx +1 -1
- package/src/ui/components/fileManagement/FileDetailsModal.tsx +1 -1
- package/src/ui/components/fileManagement/FileViewer.tsx +1 -1
- package/src/ui/components/fileManagement/UploadPreview.tsx +1 -1
- package/src/ui/components/modals/DeleteAccountModal.tsx +1 -1
- package/src/ui/components/payment/PaymentDetailsStep.tsx +1 -1
- package/src/ui/components/payment/PaymentMethodStep.tsx +1 -1
- package/src/ui/components/payment/PaymentReviewStep.tsx +1 -1
- package/src/ui/components/payment/PaymentSuccessStep.tsx +1 -1
- package/src/ui/components/payment/PaymentSummaryStep.tsx +1 -1
- package/src/ui/components/payment/types.ts +24 -24
- package/src/ui/components/styles/shadow.tsx +2 -2
- package/src/ui/context/OxyContext.tsx +15 -46
- package/src/ui/context/__tests__/commitSessionFlow.test.ts +0 -89
- package/src/ui/context/commitSessionFlow.ts +0 -61
- package/src/ui/context/oxyContextTypes.ts +4 -7
- package/src/ui/context/useOxyAccountGraph.ts +4 -4
- package/src/ui/hooks/queries/userCache.ts +169 -148
- package/src/ui/hooks/useAssets.ts +1 -1
- package/src/ui/hooks/useAsyncAction.ts +2 -2
- package/src/ui/hooks/useAuth.ts +4 -2
- package/src/ui/hooks/useOnlineStatus.ts +3 -2
- package/src/ui/hooks/useSessionManagement.ts +0 -2
- package/src/ui/screens/AccountMembersScreen.tsx +1 -1
- package/src/ui/screens/ConnectedAppsScreen.tsx +1 -1
- package/src/ui/screens/CreateAccountScreen.tsx +1 -1
- package/src/ui/screens/EditProfileFieldScreen.tsx +1 -1
- package/src/ui/screens/FAQScreen.tsx +1 -1
- package/src/ui/screens/FeedbackScreen.tsx +740 -574
- package/src/ui/screens/FileManagementScreen.tsx +2 -1
- package/src/ui/screens/HistoryViewScreen.tsx +4 -19
- package/src/ui/screens/LanguageSelectorScreen.tsx +1 -1
- package/src/ui/screens/ManageAccountScreen.tsx +1 -1
- package/src/ui/screens/PaymentGatewayScreen.tsx +1 -1
- package/src/ui/screens/PremiumSubscriptionScreen.tsx +2 -2
- package/src/ui/screens/PrivacySettingsScreen.tsx +1 -0
- package/src/ui/screens/ProfileScreen.tsx +6 -4
- package/src/ui/screens/UserListScreen.tsx +3 -3
- package/src/ui/screens/WelcomeNewUserScreen.tsx +6 -6
- package/src/ui/screens/fileManagement/FileLibraryError.tsx +1 -1
- package/src/ui/screens/fileManagement/FileListSection.tsx +1 -1
- package/src/ui/screens/fileManagement/PhotoPickerSection.tsx +3 -2
- package/src/ui/screens/fileManagement/UploadBar.tsx +1 -1
- package/src/ui/screens/trust/TrustCenterScreen.tsx +1 -1
- package/src/ui/screens/trust/TrustLeaderboardScreen.tsx +4 -3
- package/src/ui/screens/trust/TrustRewardsScreen.tsx +1 -1
- package/src/ui/types/navigation.ts +20 -19
- package/src/ui/utils/fileManagement.ts +108 -92
- package/src/ui/utils/netConnectivity.ts +27 -0
- package/src/ui/utils/oauthReturn.ts +15 -30
- package/lib/commonjs/ui/oauth/legacyRedirectLanes.js +0 -48
- package/lib/commonjs/ui/oauth/legacyRedirectLanes.js.map +0 -1
- package/lib/commonjs/ui/utils/crossOriginRestore.js +0 -140
- package/lib/commonjs/ui/utils/crossOriginRestore.js.map +0 -1
- package/lib/module/ui/oauth/legacyRedirectLanes.js +0 -44
- package/lib/module/ui/oauth/legacyRedirectLanes.js.map +0 -1
- package/lib/module/ui/utils/crossOriginRestore.js +0 -131
- package/lib/module/ui/utils/crossOriginRestore.js.map +0 -1
- package/lib/typescript/commonjs/ui/oauth/legacyRedirectLanes.d.ts +0 -40
- package/lib/typescript/commonjs/ui/oauth/legacyRedirectLanes.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/utils/crossOriginRestore.d.ts +0 -43
- package/lib/typescript/commonjs/ui/utils/crossOriginRestore.d.ts.map +0 -1
- package/lib/typescript/module/ui/oauth/legacyRedirectLanes.d.ts +0 -40
- package/lib/typescript/module/ui/oauth/legacyRedirectLanes.d.ts.map +0 -1
- package/lib/typescript/module/ui/utils/crossOriginRestore.d.ts +0 -43
- package/lib/typescript/module/ui/utils/crossOriginRestore.d.ts.map +0 -1
- package/src/ui/boot/__tests__/coldBootWebAuthMode.test.ts +0 -281
- package/src/ui/oauth/legacyRedirectLanes.ts +0 -43
- package/src/ui/utils/__tests__/crossOriginRestore.test.ts +0 -160
- package/src/ui/utils/crossOriginRestore.ts +0 -168
|
@@ -26,7 +26,6 @@ import {
|
|
|
26
26
|
startTokenRefreshScheduler,
|
|
27
27
|
createAccountDialogController,
|
|
28
28
|
logger as loggerUtil,
|
|
29
|
-
syncHubAfterSignIn,
|
|
30
29
|
} from '@oxyhq/core';
|
|
31
30
|
import {
|
|
32
31
|
registerAccountDialogControls,
|
|
@@ -79,7 +78,7 @@ import type {
|
|
|
79
78
|
CommitInput,
|
|
80
79
|
} from './oxyContextTypes';
|
|
81
80
|
import { DEFAULT_SESSION_VALIDITY_MS, loadUseFollowHook } from './oxyContextHelpers';
|
|
82
|
-
import { commitDeviceSetAndResolve
|
|
81
|
+
import { commitDeviceSetAndResolve } from './commitSessionFlow';
|
|
83
82
|
import { runPasskeyLogin, runPasskeyRegister, runPasskeyAdd } from './passkeyFlow';
|
|
84
83
|
import {
|
|
85
84
|
isPasskeySupported,
|
|
@@ -103,8 +102,7 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
|
|
|
103
102
|
storageKeyPrefix = 'oxy_session',
|
|
104
103
|
clientId: clientIdProp,
|
|
105
104
|
sessionMode = 'account',
|
|
106
|
-
webAuthMode = '
|
|
107
|
-
hubSync = true,
|
|
105
|
+
webAuthMode = 'popup',
|
|
108
106
|
onAuthStateChange,
|
|
109
107
|
onError,
|
|
110
108
|
}) => {
|
|
@@ -586,7 +584,7 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
|
|
|
586
584
|
};
|
|
587
585
|
handleTokenChange(oxyServices.getAccessToken());
|
|
588
586
|
return oxyServices.onTokensChanged(handleTokenChange);
|
|
589
|
-
}, [logger, oxyServices]);
|
|
587
|
+
}, [logger, oxyServices, sessionClient]);
|
|
590
588
|
|
|
591
589
|
// Unified in-session refresh (SDK-owned; every RP inherits it). Installs the
|
|
592
590
|
// ONE core refresh handler (re-mint from the persisted zero-cookie device
|
|
@@ -616,10 +614,7 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
|
|
|
616
614
|
// Used by the QR device flow (`handleWebSession`), password sign-in, 2FA
|
|
617
615
|
// completion, and the cold boot.
|
|
618
616
|
const commitSession = useCallback(
|
|
619
|
-
async (
|
|
620
|
-
input: CommitInput,
|
|
621
|
-
options: { activate: boolean; hubSync?: boolean },
|
|
622
|
-
): Promise<void> => {
|
|
617
|
+
async (input: CommitInput, options: { activate: boolean }): Promise<void> => {
|
|
623
618
|
if (input.accessToken) {
|
|
624
619
|
oxyServices.setTokens(input.accessToken);
|
|
625
620
|
}
|
|
@@ -687,21 +682,8 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
|
|
|
687
682
|
onAuthStateChange: onAuthStateChangeRef.current,
|
|
688
683
|
markAuthResolved: markAuthResolvedRef.current,
|
|
689
684
|
});
|
|
690
|
-
|
|
691
|
-
// Post-sign-in hub sync — a full-page redirect to auth.oxy.so. Gated HERE,
|
|
692
|
-
// inside the ONE commit funnel, so NO commit path (QR device flow,
|
|
693
|
-
// password/2FA through the account dialog, passkey, popup OAuth, cold
|
|
694
|
-
// boot) can bounce a `webAuthMode: 'popup'` tab to the IdP. See
|
|
695
|
-
// `maybeSyncHubAfterCommit` for the full gate list.
|
|
696
|
-
await maybeSyncHubAfterCommit({
|
|
697
|
-
activate: options.activate,
|
|
698
|
-
hubSyncRequested: options.hubSync === true,
|
|
699
|
-
hubSyncEnabled: hubSync,
|
|
700
|
-
webAuthMode,
|
|
701
|
-
syncHub: () => syncHubAfterSignIn(oxyServices, { enabled: hubSync }),
|
|
702
|
-
});
|
|
703
685
|
},
|
|
704
|
-
[oxyServices, authStore, updateSessions, setActiveSessionId, sessionClient, sessionClientHost, syncFromClient, loginSuccess, logger
|
|
686
|
+
[oxyServices, authStore, updateSessions, setActiveSessionId, sessionClient, sessionClientHost, syncFromClient, loginSuccess, logger],
|
|
705
687
|
);
|
|
706
688
|
const commitSessionRef = useRef(commitSession);
|
|
707
689
|
commitSessionRef.current = commitSession;
|
|
@@ -723,16 +705,16 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
|
|
|
723
705
|
userId: session.user.id,
|
|
724
706
|
user: session.user,
|
|
725
707
|
},
|
|
726
|
-
{ activate: true
|
|
708
|
+
{ activate: true },
|
|
727
709
|
);
|
|
728
710
|
},
|
|
729
711
|
[commitSession],
|
|
730
712
|
);
|
|
731
713
|
|
|
732
|
-
// Commit a minted graph-SWITCH session
|
|
733
|
-
//
|
|
734
|
-
//
|
|
735
|
-
//
|
|
714
|
+
// Commit a minted graph-SWITCH session through the same funnel as
|
|
715
|
+
// `handleWebSession`. Nothing extra to do IN-PLACE: the switch already
|
|
716
|
+
// propagates across tabs/apps via the server's `session_state` socket
|
|
717
|
+
// broadcast.
|
|
736
718
|
const commitSwitchedSession = useCallback(
|
|
737
719
|
async (session: SessionLoginResponse): Promise<void> => {
|
|
738
720
|
if (!session?.user || !session?.sessionId || !session.accessToken) {
|
|
@@ -748,7 +730,7 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
|
|
|
748
730
|
userId: session.user.id,
|
|
749
731
|
user: session.user,
|
|
750
732
|
},
|
|
751
|
-
{ activate: true
|
|
733
|
+
{ activate: true },
|
|
752
734
|
);
|
|
753
735
|
},
|
|
754
736
|
[commitSession],
|
|
@@ -759,11 +741,6 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
|
|
|
759
741
|
// to, so no consumer ever writes popup listeners or a token exchange. The
|
|
760
742
|
// transport picks popup vs redirect from `webAuthMode`; both lanes land on the
|
|
761
743
|
// SAME completion path (`completeOAuthCode`) and the same commit funnel here.
|
|
762
|
-
//
|
|
763
|
-
// `hubSync: false` is deliberate: hub sync is a full-page redirect to
|
|
764
|
-
// auth.oxy.so, which would undo the one thing popup mode exists to guarantee —
|
|
765
|
-
// that the relying party never leaves its route. It matches how the redirect
|
|
766
|
-
// lane's return leg commits (see `runProviderColdBoot`).
|
|
767
744
|
const startWebOAuthSignInForContext = useCallback(
|
|
768
745
|
(options: StartWebOAuthSignInOptions): Promise<WebOAuthSignInResult> =>
|
|
769
746
|
startWebOAuthSignIn(
|
|
@@ -773,8 +750,7 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
|
|
|
773
750
|
clientId,
|
|
774
751
|
authorizeBaseUrl,
|
|
775
752
|
identityBound: isIdentityBound,
|
|
776
|
-
commitSession: (input) =>
|
|
777
|
-
commitSessionRef.current(input, { activate: true, hubSync: false }),
|
|
753
|
+
commitSession: (input) => commitSessionRef.current(input, { activate: true }),
|
|
778
754
|
},
|
|
779
755
|
options,
|
|
780
756
|
),
|
|
@@ -973,7 +949,7 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
|
|
|
973
949
|
getLoginOptions: (username) => oxyServices.webauthnLoginOptions(username),
|
|
974
950
|
runCeremony: runAuthenticationCeremony,
|
|
975
951
|
loginVerify: (response, envelope) => oxyServices.webauthnLoginVerify(response, envelope),
|
|
976
|
-
commit: (input) => commitSession(input, { activate: true
|
|
952
|
+
commit: (input) => commitSession(input, { activate: true }),
|
|
977
953
|
username: opts?.username,
|
|
978
954
|
deviceId: persisted?.deviceId,
|
|
979
955
|
deviceName: opts?.deviceName,
|
|
@@ -991,7 +967,7 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
|
|
|
991
967
|
getRegisterOptions: (username) => oxyServices.webauthnRegisterOptions(username),
|
|
992
968
|
runCeremony: runRegistrationCeremony,
|
|
993
969
|
registerVerify: (response, envelope) => oxyServices.webauthnRegisterVerify(response, envelope),
|
|
994
|
-
commit: (input) => commitSession(input, { activate: true
|
|
970
|
+
commit: (input) => commitSession(input, { activate: true }),
|
|
995
971
|
username: params.username,
|
|
996
972
|
deviceName: params.deviceName,
|
|
997
973
|
});
|
|
@@ -1043,13 +1019,8 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
|
|
|
1043
1019
|
authStore,
|
|
1044
1020
|
clientId: clientIdProp,
|
|
1045
1021
|
authRedirectUri,
|
|
1046
|
-
authorizeBaseUrl,
|
|
1047
1022
|
sessionMode,
|
|
1048
1023
|
identity: identity?.binding,
|
|
1049
|
-
// Popup mode forbids the boot's automatic full-page `prompt=none` restore:
|
|
1050
|
-
// a domain with no local credential resolves signed out instead of
|
|
1051
|
-
// navigating the tab to the IdP (see `allowsAutomaticIdpRedirect`).
|
|
1052
|
-
webAuthMode,
|
|
1053
1024
|
sessionClient,
|
|
1054
1025
|
syncDeviceCredentialToHost,
|
|
1055
1026
|
commitSession: (input, options) => commitSessionRef.current(input, options),
|
|
@@ -1067,10 +1038,8 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
|
|
|
1067
1038
|
authStore,
|
|
1068
1039
|
clientIdProp,
|
|
1069
1040
|
authRedirectUri,
|
|
1070
|
-
authorizeBaseUrl,
|
|
1071
1041
|
sessionMode,
|
|
1072
1042
|
identity,
|
|
1073
|
-
webAuthMode,
|
|
1074
1043
|
syncDeviceCredentialToHost,
|
|
1075
1044
|
sessionClient,
|
|
1076
1045
|
]);
|
|
@@ -1372,7 +1341,7 @@ const LOADING_STATE: OxyContextState = {
|
|
|
1372
1341
|
isAuthResolved: false,
|
|
1373
1342
|
isStorageReady: false,
|
|
1374
1343
|
sessionMode: 'account',
|
|
1375
|
-
webAuthMode: '
|
|
1344
|
+
webAuthMode: 'popup',
|
|
1376
1345
|
error: null,
|
|
1377
1346
|
currentLanguage: 'en-US',
|
|
1378
1347
|
currentLanguages: [],
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import type { User } from '@oxyhq/core';
|
|
2
2
|
import { logger } from '@oxyhq/core';
|
|
3
|
-
import type { WebAuthMode } from '../../oauth/types';
|
|
4
3
|
import {
|
|
5
4
|
commitDeviceSetAndResolve,
|
|
6
|
-
maybeSyncHubAfterCommit,
|
|
7
5
|
type CommitDeviceSetAndResolveDeps,
|
|
8
|
-
type MaybeSyncHubAfterCommitDeps,
|
|
9
6
|
} from '../commitSessionFlow';
|
|
10
7
|
|
|
11
8
|
// A resolved promise chain (addCurrentAccount -> start -> syncFromClient) settles
|
|
@@ -194,92 +191,6 @@ describe('commitDeviceSetAndResolve — cold boot (activate: false)', () => {
|
|
|
194
191
|
});
|
|
195
192
|
});
|
|
196
193
|
|
|
197
|
-
/**
|
|
198
|
-
* Post-sign-in hub sync is a FULL-PAGE redirect to auth.oxy.so. It runs from the
|
|
199
|
-
* ONE commit funnel, so gating it here gates every commit path at once —
|
|
200
|
-
* `webAuthMode: 'popup'` must never bounce the tab, whichever path signed the
|
|
201
|
-
* user in (#691 phase 7).
|
|
202
|
-
*/
|
|
203
|
-
describe('maybeSyncHubAfterCommit — webAuthMode transport gate (#691 phase 7)', () => {
|
|
204
|
-
const buildHubDeps = (
|
|
205
|
-
overrides: Partial<MaybeSyncHubAfterCommitDeps> = {},
|
|
206
|
-
): MaybeSyncHubAfterCommitDeps => ({
|
|
207
|
-
activate: true,
|
|
208
|
-
hubSyncRequested: true,
|
|
209
|
-
hubSyncEnabled: true,
|
|
210
|
-
webAuthMode: 'redirect',
|
|
211
|
-
syncHub: jest.fn(async () => true),
|
|
212
|
-
...overrides,
|
|
213
|
-
});
|
|
214
|
-
|
|
215
|
-
it("redirect mode: syncs the hub after a deliberate sign-in (unchanged)", async () => {
|
|
216
|
-
const deps = buildHubDeps();
|
|
217
|
-
|
|
218
|
-
await expect(maybeSyncHubAfterCommit(deps)).resolves.toBe(true);
|
|
219
|
-
|
|
220
|
-
expect(deps.syncHub).toHaveBeenCalledTimes(1);
|
|
221
|
-
});
|
|
222
|
-
|
|
223
|
-
it('popup mode: NEVER syncs the hub, even on an otherwise-eligible sign-in', async () => {
|
|
224
|
-
const deps = buildHubDeps({ webAuthMode: 'popup' });
|
|
225
|
-
|
|
226
|
-
await expect(maybeSyncHubAfterCommit(deps)).resolves.toBe(false);
|
|
227
|
-
|
|
228
|
-
expect(deps.syncHub).not.toHaveBeenCalled();
|
|
229
|
-
});
|
|
230
|
-
|
|
231
|
-
it('popup mode: no commit path can opt back in', async () => {
|
|
232
|
-
// Every commit path differs only in `activate` / `hubSyncRequested`; the
|
|
233
|
-
// transport gate outranks all of them.
|
|
234
|
-
for (const activate of [true, false]) {
|
|
235
|
-
for (const hubSyncRequested of [true, false]) {
|
|
236
|
-
const deps = buildHubDeps({ webAuthMode: 'popup', activate, hubSyncRequested });
|
|
237
|
-
await expect(maybeSyncHubAfterCommit(deps)).resolves.toBe(false);
|
|
238
|
-
expect(deps.syncHub).not.toHaveBeenCalled();
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
});
|
|
242
|
-
|
|
243
|
-
it.each(['popup', 'redirect'] as const)(
|
|
244
|
-
'never syncs on a cold-boot restore, in either mode (%s)',
|
|
245
|
-
async (webAuthMode: WebAuthMode) => {
|
|
246
|
-
const deps = buildHubDeps({ webAuthMode, activate: false });
|
|
247
|
-
|
|
248
|
-
await expect(maybeSyncHubAfterCommit(deps)).resolves.toBe(false);
|
|
249
|
-
|
|
250
|
-
expect(deps.syncHub).not.toHaveBeenCalled();
|
|
251
|
-
},
|
|
252
|
-
);
|
|
253
|
-
|
|
254
|
-
it('redirect mode: honours the per-commit opt-out (account switch / popup OAuth lanes)', async () => {
|
|
255
|
-
const deps = buildHubDeps({ hubSyncRequested: false });
|
|
256
|
-
|
|
257
|
-
await expect(maybeSyncHubAfterCommit(deps)).resolves.toBe(false);
|
|
258
|
-
|
|
259
|
-
expect(deps.syncHub).not.toHaveBeenCalled();
|
|
260
|
-
});
|
|
261
|
-
|
|
262
|
-
it('redirect mode: honours the provider-level hubSync opt-out', async () => {
|
|
263
|
-
const deps = buildHubDeps({ hubSyncEnabled: false });
|
|
264
|
-
|
|
265
|
-
await expect(maybeSyncHubAfterCommit(deps)).resolves.toBe(false);
|
|
266
|
-
|
|
267
|
-
expect(deps.syncHub).not.toHaveBeenCalled();
|
|
268
|
-
});
|
|
269
|
-
|
|
270
|
-
it('redirect mode: a failing hub sync is non-fatal and never rejects', async () => {
|
|
271
|
-
const deps = buildHubDeps({
|
|
272
|
-
syncHub: jest.fn(async () => {
|
|
273
|
-
throw new Error('hub ticket failed');
|
|
274
|
-
}),
|
|
275
|
-
});
|
|
276
|
-
|
|
277
|
-
await expect(maybeSyncHubAfterCommit(deps)).resolves.toBe(false);
|
|
278
|
-
|
|
279
|
-
expect(deps.syncHub).toHaveBeenCalledTimes(1);
|
|
280
|
-
});
|
|
281
|
-
});
|
|
282
|
-
|
|
283
194
|
describe('commitDeviceSetAndResolve — deliberate sign-in (activate: true)', () => {
|
|
284
195
|
it('BLOCKS on the device-set reconcile before resolving auth (unchanged ordering)', async () => {
|
|
285
196
|
const order: string[] = [];
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import type { User } from '@oxyhq/core';
|
|
2
2
|
import { logger as loggerUtil } from '@oxyhq/core';
|
|
3
|
-
import { allowsAutomaticIdpRedirect } from '../oauth/legacyRedirectLanes';
|
|
4
|
-
import type { WebAuthMode } from '../oauth/types';
|
|
5
|
-
import { isWebBrowser } from '../utils/isWebBrowser';
|
|
6
3
|
import { isUnauthorizedStatus } from './oxyContextHelpers';
|
|
7
4
|
|
|
8
5
|
const LOG_CONTEXT = { component: 'OxyContext', method: 'commitSession' } as const;
|
|
@@ -129,61 +126,3 @@ export async function commitDeviceSetAndResolve(
|
|
|
129
126
|
await hydrateAndResolve();
|
|
130
127
|
void reconcileDeviceSet().catch(logReconcileError);
|
|
131
128
|
}
|
|
132
|
-
|
|
133
|
-
export interface MaybeSyncHubAfterCommitDeps {
|
|
134
|
-
/** Deliberate sign-in (`true`) vs. a cold-boot / background commit (`false`). */
|
|
135
|
-
activate: boolean;
|
|
136
|
-
/** Per-commit opt-in — `commitSession`'s `options.hubSync`. */
|
|
137
|
-
hubSyncRequested: boolean;
|
|
138
|
-
/** Provider-level opt-out — `OxyProviderProps.hubSync`. */
|
|
139
|
-
hubSyncEnabled: boolean;
|
|
140
|
-
/**
|
|
141
|
-
* The provider's web sign-in transport — `OxyProviderProps.webAuthMode`.
|
|
142
|
-
* A first-class input: `'popup'` forbids the redirect outright.
|
|
143
|
-
*/
|
|
144
|
-
webAuthMode: WebAuthMode;
|
|
145
|
-
/**
|
|
146
|
-
* Starts the full-page hop to `auth.oxy.so/sync`; resolves `true` when the
|
|
147
|
-
* navigation was actually started.
|
|
148
|
-
*/
|
|
149
|
-
syncHub: () => Promise<boolean>;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* Post-sign-in hub sync: plant this device's credential on the IdP hub so OTHER
|
|
154
|
-
* official origins can silently restore a session on their next cold boot.
|
|
155
|
-
*
|
|
156
|
-
* The tail of the ONE commit funnel (`commitSession`), extracted so every gate
|
|
157
|
-
* on this legacy lane lives — and is tested — in one place. Returns whether the
|
|
158
|
-
* full-page redirect was started; a failure is non-fatal and never propagates
|
|
159
|
-
* (the sign-in itself already succeeded).
|
|
160
|
-
*
|
|
161
|
-
* Four gates, all of which must pass:
|
|
162
|
-
* 1. `activate` — only a deliberate sign-in syncs; a cold-boot restore never does.
|
|
163
|
-
* 2. `hubSyncRequested` — the in-place lanes (account switch, popup OAuth) opt out.
|
|
164
|
-
* 3. `hubSyncEnabled` — the provider-level `hubSync` prop.
|
|
165
|
-
* 4. `allowsAutomaticIdpRedirect(webAuthMode)` — hub sync REPLACES the document
|
|
166
|
-
* with `auth.oxy.so`, so `webAuthMode: 'popup'` forbids it: a redirect that
|
|
167
|
-
* bounces the tab defeats the entire point of the mode, no matter which
|
|
168
|
-
* commit path produced the session (issue #691, "Cold boot and cross-domain
|
|
169
|
-
* behavior"). Redirect mode — the default and the compatibility path — is
|
|
170
|
-
* unchanged, and this whole function disappears with it in phase 7b.
|
|
171
|
-
*/
|
|
172
|
-
export async function maybeSyncHubAfterCommit(
|
|
173
|
-
deps: MaybeSyncHubAfterCommitDeps,
|
|
174
|
-
): Promise<boolean> {
|
|
175
|
-
const { activate, hubSyncRequested, hubSyncEnabled, webAuthMode, syncHub } = deps;
|
|
176
|
-
|
|
177
|
-
if (!activate || !hubSyncRequested || !hubSyncEnabled) return false;
|
|
178
|
-
if (!allowsAutomaticIdpRedirect(webAuthMode)) return false;
|
|
179
|
-
if (!isWebBrowser()) return false;
|
|
180
|
-
|
|
181
|
-
try {
|
|
182
|
-
return await syncHub();
|
|
183
|
-
} catch (hubError) {
|
|
184
|
-
if (__DEV__) {
|
|
185
|
-
loggerUtil.debug('Hub sync after sign-in failed (non-fatal)', LOG_CONTEXT, hubError);
|
|
186
|
-
}
|
|
187
|
-
return false;
|
|
188
|
-
}
|
|
189
|
-
}
|
|
@@ -158,10 +158,9 @@ export interface OxyContextProviderProps {
|
|
|
158
158
|
authWebUrl?: string;
|
|
159
159
|
authRedirectUri?: string;
|
|
160
160
|
/**
|
|
161
|
-
* Authorize endpoint override for
|
|
162
|
-
*
|
|
163
|
-
*
|
|
164
|
-
* bounces the tab to production `auth.oxy.so`.
|
|
161
|
+
* Authorize endpoint override for web "Sign in with Oxy". Defaults to the
|
|
162
|
+
* production Oxy IdP when unset; a local/staging deployment points it at its
|
|
163
|
+
* own IdP so sign-in never reaches production `auth.oxy.so`.
|
|
165
164
|
*/
|
|
166
165
|
authorizeBaseUrl?: string;
|
|
167
166
|
storageKeyPrefix?: string;
|
|
@@ -174,11 +173,9 @@ export interface OxyContextProviderProps {
|
|
|
174
173
|
sessionMode?: SessionMode;
|
|
175
174
|
/**
|
|
176
175
|
* Transport for WEB third-party sign-in. See `OxyProviderProps.webAuthMode`.
|
|
177
|
-
* @default '
|
|
176
|
+
* @default 'popup'
|
|
178
177
|
*/
|
|
179
178
|
webAuthMode?: WebAuthMode;
|
|
180
|
-
/** Sync device credentials to auth.oxy.so after interactive sign-in. @default true */
|
|
181
|
-
hubSync?: boolean;
|
|
182
179
|
onAuthStateChange?: (user: User | null) => void;
|
|
183
180
|
onError?: (error: ApiError) => void;
|
|
184
181
|
}
|
|
@@ -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
|
|
25
|
+
commitSession: (input: CommitInput, options: { activate: 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
|
-
//
|
|
115
|
-
{ activate: true
|
|
113
|
+
// A switch is IN-PLACE. Cross-tab/app propagation rides the
|
|
114
|
+
// `session_state` socket.
|
|
115
|
+
{ activate: true },
|
|
116
116
|
);
|
|
117
117
|
await runPostAccountSwitchSideEffects();
|
|
118
118
|
},
|