@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
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `runProviderColdBoot` — the `webAuthMode` transport gate (#691 phase 7).
|
|
3
|
+
*
|
|
4
|
+
* `webAuthMode: 'popup'` must never let the boot navigate the RP's top-level
|
|
5
|
+
* window: no silent `prompt=none` restore, no authorize redirect, a signed-out
|
|
6
|
+
* domain simply resolves signed out. `'redirect'` — still the default and the
|
|
7
|
+
* compatibility path — must behave exactly as before.
|
|
8
|
+
*
|
|
9
|
+
* Unlike `__tests__/boot/runProviderColdBoot.test.ts` (deadline + connectivity
|
|
10
|
+
* wiring, with `crossOriginRestore` stubbed out), this suite keeps the restore
|
|
11
|
+
* lane REAL so the redirect-mode assertions reach the actual navigation
|
|
12
|
+
* primitive — the thing popup mode has to suppress.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import type { AuthStateStore, PersistedAuthState, SessionClient } from '@oxyhq/core';
|
|
16
|
+
|
|
17
|
+
// Only `runSessionColdBoot` and the origin-CLASSIFICATION predicates are faked.
|
|
18
|
+
// jsdom's `location` is non-configurable, so origin eligibility has to be driven
|
|
19
|
+
// through the predicates (their real behaviour is covered by core's own tests);
|
|
20
|
+
// everything else in core (PKCE, authorize-URL builder, handshake store) stays
|
|
21
|
+
// real so the redirect-mode lane is exercised end to end.
|
|
22
|
+
jest.mock('@oxyhq/core', () => {
|
|
23
|
+
const actual = jest.requireActual('@oxyhq/core');
|
|
24
|
+
return {
|
|
25
|
+
__esModule: true,
|
|
26
|
+
...actual,
|
|
27
|
+
runSessionColdBoot: jest.fn(),
|
|
28
|
+
isLoopbackOrigin: jest.fn(() => false),
|
|
29
|
+
isOfficialWebOrigin: jest.fn(() => true),
|
|
30
|
+
isIdpHubOrigin: jest.fn(() => false),
|
|
31
|
+
};
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
// The ONLY top-level-window navigation primitive either lane can reach.
|
|
35
|
+
jest.mock('../../components/oauthNavigation', () => ({
|
|
36
|
+
redirectToAuthorize: jest.fn(),
|
|
37
|
+
}));
|
|
38
|
+
|
|
39
|
+
// Spied but REAL: redirect mode must still perform the actual restore.
|
|
40
|
+
jest.mock('../../utils/crossOriginRestore', () => {
|
|
41
|
+
const actual = jest.requireActual('../../utils/crossOriginRestore');
|
|
42
|
+
return {
|
|
43
|
+
__esModule: true,
|
|
44
|
+
...actual,
|
|
45
|
+
maybeStartSilentOAuthRestore: jest.fn(actual.maybeStartSilentOAuthRestore),
|
|
46
|
+
consumeSilentOAuthError: jest.fn(actual.consumeSilentOAuthError),
|
|
47
|
+
};
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
jest.mock('../../utils/oauthReturn', () => {
|
|
51
|
+
const actual = jest.requireActual('../../utils/oauthReturn');
|
|
52
|
+
return {
|
|
53
|
+
__esModule: true,
|
|
54
|
+
...actual,
|
|
55
|
+
tryCompleteOAuthReturn: jest.fn(async () => false),
|
|
56
|
+
consumeHubSyncFailure: jest.fn(actual.consumeHubSyncFailure),
|
|
57
|
+
};
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
import { runSessionColdBoot } from '@oxyhq/core';
|
|
61
|
+
import { redirectToAuthorize } from '../../components/oauthNavigation';
|
|
62
|
+
import {
|
|
63
|
+
clearCrossOriginRestoreGuards,
|
|
64
|
+
consumeSilentOAuthError,
|
|
65
|
+
maybeStartSilentOAuthRestore,
|
|
66
|
+
} from '../../utils/crossOriginRestore';
|
|
67
|
+
import { consumeHubSyncFailure, tryCompleteOAuthReturn } from '../../utils/oauthReturn';
|
|
68
|
+
import { runProviderColdBoot, type RunProviderColdBootOptions } from '../runProviderColdBoot';
|
|
69
|
+
|
|
70
|
+
const mockRunSessionColdBoot = runSessionColdBoot as jest.Mock;
|
|
71
|
+
const mockRedirectToAuthorize = redirectToAuthorize as jest.Mock;
|
|
72
|
+
const mockSilentRestore = maybeStartSilentOAuthRestore as jest.Mock;
|
|
73
|
+
const mockConsumeSilentOAuthError = consumeSilentOAuthError as jest.Mock;
|
|
74
|
+
const mockConsumeHubSyncFailure = consumeHubSyncFailure as jest.Mock;
|
|
75
|
+
const mockTryCompleteOAuthReturn = tryCompleteOAuthReturn as jest.Mock;
|
|
76
|
+
|
|
77
|
+
const CLIENT_ID = 'oxy_dk_test';
|
|
78
|
+
|
|
79
|
+
/** An auth store holding no device credential — the signed-out domain case. */
|
|
80
|
+
function makeEmptyAuthStore(): AuthStateStore {
|
|
81
|
+
return {
|
|
82
|
+
load: jest.fn(async (): Promise<PersistedAuthState | null> => null),
|
|
83
|
+
save: jest.fn(async () => undefined),
|
|
84
|
+
clear: jest.fn(async () => undefined),
|
|
85
|
+
} as unknown as AuthStateStore;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
interface Harness {
|
|
89
|
+
options: RunProviderColdBootOptions;
|
|
90
|
+
commitSession: jest.Mock;
|
|
91
|
+
markAuthResolved: jest.Mock;
|
|
92
|
+
setTokenReady: jest.Mock;
|
|
93
|
+
sessionClientStart: jest.Mock;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function makeHarness(overrides: Partial<RunProviderColdBootOptions> = {}): Harness {
|
|
97
|
+
const commitSession = jest.fn(async () => undefined);
|
|
98
|
+
const markAuthResolved = jest.fn();
|
|
99
|
+
const setTokenReady = jest.fn();
|
|
100
|
+
const sessionClientStart = jest.fn(async () => undefined);
|
|
101
|
+
|
|
102
|
+
const options: RunProviderColdBootOptions = {
|
|
103
|
+
oxyServices: {} as RunProviderColdBootOptions['oxyServices'],
|
|
104
|
+
authStore: makeEmptyAuthStore(),
|
|
105
|
+
clientId: CLIENT_ID,
|
|
106
|
+
sessionClient: { start: sessionClientStart } as unknown as SessionClient,
|
|
107
|
+
syncDeviceCredentialToHost: jest.fn(async () => undefined),
|
|
108
|
+
commitSession,
|
|
109
|
+
markAuthResolved,
|
|
110
|
+
setTokenReady,
|
|
111
|
+
...overrides,
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
return { options, commitSession, markAuthResolved, setTokenReady, sessionClientStart };
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/** `runSessionColdBoot` finding no session at all — the signed-out domain. */
|
|
118
|
+
function stubSignedOutBoot(): void {
|
|
119
|
+
mockRunSessionColdBoot.mockImplementation(async (opts: Parameters<typeof runSessionColdBoot>[0]) => {
|
|
120
|
+
await opts.onSignedOut?.('no_session');
|
|
121
|
+
return { kind: 'unauthenticated' } as const;
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
describe('runProviderColdBoot — webAuthMode transport gate (#691 phase 7)', () => {
|
|
126
|
+
beforeEach(() => {
|
|
127
|
+
mockRunSessionColdBoot.mockReset();
|
|
128
|
+
mockRedirectToAuthorize.mockClear();
|
|
129
|
+
mockSilentRestore.mockClear();
|
|
130
|
+
mockConsumeSilentOAuthError.mockClear();
|
|
131
|
+
mockConsumeHubSyncFailure.mockClear();
|
|
132
|
+
mockTryCompleteOAuthReturn.mockClear();
|
|
133
|
+
mockTryCompleteOAuthReturn.mockImplementation(async () => false);
|
|
134
|
+
globalThis.sessionStorage?.clear();
|
|
135
|
+
clearCrossOriginRestoreGuards();
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
describe("webAuthMode: 'popup'", () => {
|
|
139
|
+
it('never starts the silent restore and never navigates the top-level window', async () => {
|
|
140
|
+
stubSignedOutBoot();
|
|
141
|
+
const { options } = makeHarness({ webAuthMode: 'popup' });
|
|
142
|
+
|
|
143
|
+
await runProviderColdBoot(options);
|
|
144
|
+
|
|
145
|
+
expect(mockSilentRestore).not.toHaveBeenCalled();
|
|
146
|
+
expect(mockRedirectToAuthorize).not.toHaveBeenCalled();
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
it('resolves a domain with no local credential SIGNED OUT instead of bouncing', async () => {
|
|
150
|
+
stubSignedOutBoot();
|
|
151
|
+
const { options, markAuthResolved, commitSession, sessionClientStart } = makeHarness({
|
|
152
|
+
webAuthMode: 'popup',
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
await runProviderColdBoot(options);
|
|
156
|
+
|
|
157
|
+
// Auth resolution concluded (routing can settle), nothing was committed,
|
|
158
|
+
// and with no persisted credential the device socket is not started.
|
|
159
|
+
expect(markAuthResolved).toHaveBeenCalled();
|
|
160
|
+
expect(commitSession).not.toHaveBeenCalled();
|
|
161
|
+
expect(sessionClientStart).not.toHaveBeenCalled();
|
|
162
|
+
expect(mockRedirectToAuthorize).not.toHaveBeenCalled();
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
it('still completes an authorization code already on the URL (blocked-popup fallback)', async () => {
|
|
166
|
+
// A popup-mode app lands here whenever the browser blocked the popup and
|
|
167
|
+
// `startWebOAuthSignIn` fell back to a full-page redirect.
|
|
168
|
+
mockTryCompleteOAuthReturn.mockImplementation(async () => true);
|
|
169
|
+
const { options, markAuthResolved, setTokenReady } = makeHarness({ webAuthMode: 'popup' });
|
|
170
|
+
|
|
171
|
+
await runProviderColdBoot(options);
|
|
172
|
+
|
|
173
|
+
expect(mockTryCompleteOAuthReturn).toHaveBeenCalledTimes(1);
|
|
174
|
+
expect(setTokenReady).toHaveBeenLastCalledWith(true);
|
|
175
|
+
expect(markAuthResolved).toHaveBeenCalled();
|
|
176
|
+
// The device mint is short-circuited by the completed return leg.
|
|
177
|
+
expect(mockRunSessionColdBoot).not.toHaveBeenCalled();
|
|
178
|
+
expect(mockRedirectToAuthorize).not.toHaveBeenCalled();
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
it('commits the OAuth return WITHOUT hub sync', async () => {
|
|
182
|
+
mockTryCompleteOAuthReturn.mockImplementation(async () => true);
|
|
183
|
+
const { options } = makeHarness({ webAuthMode: 'popup' });
|
|
184
|
+
|
|
185
|
+
await runProviderColdBoot(options);
|
|
186
|
+
|
|
187
|
+
const commit = mockTryCompleteOAuthReturn.mock.calls[0][0] as {
|
|
188
|
+
commitSession: (input: unknown) => Promise<void>;
|
|
189
|
+
};
|
|
190
|
+
await commit.commitSession({ sessionId: 's1', userId: 'u1' });
|
|
191
|
+
expect(options.commitSession).toHaveBeenCalledWith(
|
|
192
|
+
{ sessionId: 's1', userId: 'u1' },
|
|
193
|
+
{ activate: true, hubSync: false },
|
|
194
|
+
);
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
describe("webAuthMode: 'redirect' (unchanged compatibility path)", () => {
|
|
199
|
+
it('starts the silent restore and navigates to the IdP with prompt=none', async () => {
|
|
200
|
+
stubSignedOutBoot();
|
|
201
|
+
const { options } = makeHarness({ webAuthMode: 'redirect' });
|
|
202
|
+
|
|
203
|
+
await runProviderColdBoot(options);
|
|
204
|
+
|
|
205
|
+
expect(mockSilentRestore).toHaveBeenCalledTimes(1);
|
|
206
|
+
expect(mockRedirectToAuthorize).toHaveBeenCalledTimes(1);
|
|
207
|
+
const url = new URL(mockRedirectToAuthorize.mock.calls[0][0] as string);
|
|
208
|
+
expect(url.origin + url.pathname).toBe('https://auth.oxy.so/authorize');
|
|
209
|
+
expect(url.searchParams.get('client_id')).toBe(CLIENT_ID);
|
|
210
|
+
expect(url.searchParams.get('prompt')).toBe('none');
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
it('is the DEFAULT when no webAuthMode is supplied', async () => {
|
|
214
|
+
stubSignedOutBoot();
|
|
215
|
+
const { options } = makeHarness();
|
|
216
|
+
|
|
217
|
+
await runProviderColdBoot(options);
|
|
218
|
+
|
|
219
|
+
expect(mockSilentRestore).toHaveBeenCalledTimes(1);
|
|
220
|
+
expect(mockRedirectToAuthorize).toHaveBeenCalledTimes(1);
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
it('does NOT restore when the mint already resolved a session', async () => {
|
|
224
|
+
mockRunSessionColdBoot.mockImplementation(async (opts: Parameters<typeof runSessionColdBoot>[0]) => {
|
|
225
|
+
const session = { sessionId: 's1', userId: 'u1', accessToken: 'at', via: 'device-secret-mint' };
|
|
226
|
+
await opts.onSession?.(session);
|
|
227
|
+
return { kind: 'session', via: session.via, session } as const;
|
|
228
|
+
});
|
|
229
|
+
const { options, commitSession } = makeHarness({ webAuthMode: 'redirect' });
|
|
230
|
+
|
|
231
|
+
await runProviderColdBoot(options);
|
|
232
|
+
|
|
233
|
+
expect(commitSession).toHaveBeenCalledWith(
|
|
234
|
+
{ sessionId: 's1', accessToken: 'at', userId: 'u1' },
|
|
235
|
+
{ activate: false },
|
|
236
|
+
);
|
|
237
|
+
expect(mockSilentRestore).not.toHaveBeenCalled();
|
|
238
|
+
expect(mockRedirectToAuthorize).not.toHaveBeenCalled();
|
|
239
|
+
});
|
|
240
|
+
});
|
|
241
|
+
|
|
242
|
+
describe('URL-cleanup consumers run in BOTH modes', () => {
|
|
243
|
+
it.each(['popup', 'redirect'] as const)(
|
|
244
|
+
'consumes the silent-OAuth error and hub-sync failure params (%s)',
|
|
245
|
+
async (webAuthMode) => {
|
|
246
|
+
stubSignedOutBoot();
|
|
247
|
+
const { options } = makeHarness({ webAuthMode });
|
|
248
|
+
|
|
249
|
+
await runProviderColdBoot(options);
|
|
250
|
+
|
|
251
|
+
expect(mockConsumeSilentOAuthError).toHaveBeenCalledTimes(1);
|
|
252
|
+
expect(mockConsumeHubSyncFailure).toHaveBeenCalledTimes(1);
|
|
253
|
+
},
|
|
254
|
+
);
|
|
255
|
+
|
|
256
|
+
it.each(['popup', 'redirect'] as const)(
|
|
257
|
+
'consumes an authorization code left on the URL (%s)',
|
|
258
|
+
async (webAuthMode) => {
|
|
259
|
+
stubSignedOutBoot();
|
|
260
|
+
const { options } = makeHarness({ webAuthMode });
|
|
261
|
+
|
|
262
|
+
await runProviderColdBoot(options);
|
|
263
|
+
|
|
264
|
+
expect(mockTryCompleteOAuthReturn).toHaveBeenCalledTimes(1);
|
|
265
|
+
},
|
|
266
|
+
);
|
|
267
|
+
});
|
|
268
|
+
|
|
269
|
+
describe('identity mode still skips both web OAuth lanes in either transport', () => {
|
|
270
|
+
it.each(['popup', 'redirect'] as const)('skips the return leg and the restore (%s)', async (webAuthMode) => {
|
|
271
|
+
stubSignedOutBoot();
|
|
272
|
+
const { options } = makeHarness({ webAuthMode, sessionMode: 'identity' });
|
|
273
|
+
|
|
274
|
+
await runProviderColdBoot(options);
|
|
275
|
+
|
|
276
|
+
expect(mockTryCompleteOAuthReturn).not.toHaveBeenCalled();
|
|
277
|
+
expect(mockSilentRestore).not.toHaveBeenCalled();
|
|
278
|
+
expect(mockRedirectToAuthorize).not.toHaveBeenCalled();
|
|
279
|
+
});
|
|
280
|
+
});
|
|
281
|
+
});
|
|
@@ -8,9 +8,15 @@ import {
|
|
|
8
8
|
} from '@oxyhq/core';
|
|
9
9
|
import type { SessionClient } from '@oxyhq/core';
|
|
10
10
|
import { loadPersistedDeviceCredential } from '../utils/deviceCredential';
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
consumeSilentOAuthError,
|
|
13
|
+
isSilentRestoreEligibleOrigin,
|
|
14
|
+
maybeStartSilentOAuthRestore,
|
|
15
|
+
} from '../utils/crossOriginRestore';
|
|
16
|
+
import { tryCompleteOAuthReturn, consumeHubSyncFailure } from '../utils/oauthReturn';
|
|
12
17
|
import { isWebBrowser } from '../utils/isWebBrowser';
|
|
13
|
-
import {
|
|
18
|
+
import { allowsAutomaticIdpRedirect } from '../oauth/legacyRedirectLanes';
|
|
19
|
+
import type { WebAuthMode } from '../oauth/types';
|
|
14
20
|
import type { CommitInput } from '../context/oxyContextTypes';
|
|
15
21
|
|
|
16
22
|
/** How long the cold boot waits for the post-boot SessionClient handoff (ms). */
|
|
@@ -61,8 +67,8 @@ async function detectOfflineHint(): Promise<boolean> {
|
|
|
61
67
|
}),
|
|
62
68
|
]);
|
|
63
69
|
// `null` ⇒ the probe timed out (unknown → assume online). Only an explicit
|
|
64
|
-
//
|
|
65
|
-
return
|
|
70
|
+
// `isConnected === false` disables the network steps.
|
|
71
|
+
return state?.isConnected === false;
|
|
66
72
|
} catch {
|
|
67
73
|
// NetInfo missing / probe threw — never block sign-in on a probe failure.
|
|
68
74
|
return false;
|
|
@@ -74,19 +80,39 @@ export interface RunProviderColdBootOptions {
|
|
|
74
80
|
authStore: AuthStateStore;
|
|
75
81
|
clientId?: string;
|
|
76
82
|
authRedirectUri?: string;
|
|
83
|
+
/**
|
|
84
|
+
* Authorize endpoint override for silent cross-origin restore. Defaults to
|
|
85
|
+
* the production Oxy IdP when unset; a local/staging deployment sets it so the
|
|
86
|
+
* silent-restore redirect targets its own IdP, never production.
|
|
87
|
+
*/
|
|
88
|
+
authorizeBaseUrl?: string;
|
|
77
89
|
/**
|
|
78
90
|
* Who owns the session this boot resolves. `'account'` (the default) is the
|
|
79
91
|
* device's active account — every ordinary Oxy app. `'identity'` binds the
|
|
80
92
|
* boot to the owner of this device's PRIMARY identity key and REQUIRES
|
|
81
|
-
* {@link identity}; it also disables the web OAuth
|
|
82
|
-
*
|
|
93
|
+
* {@link identity}; it also disables the two web OAuth lanes below, which
|
|
94
|
+
* commit whatever account the IdP hands back.
|
|
83
95
|
*/
|
|
84
96
|
sessionMode?: SessionMode;
|
|
85
97
|
/** The identity binding required by `sessionMode: 'identity'`. */
|
|
86
98
|
identity?: IdentityBinding;
|
|
99
|
+
/**
|
|
100
|
+
* How this provider's WEB sign-in reaches the IdP
|
|
101
|
+
* (`OxyProviderProps.webAuthMode`).
|
|
102
|
+
*
|
|
103
|
+
* A first-class INPUT to the boot, not a UI-only concern: `'popup'` forbids
|
|
104
|
+
* the automatic full-page `prompt=none` restore in step 3, so a domain with no
|
|
105
|
+
* local credential resolves SIGNED OUT instead of bouncing the top-level
|
|
106
|
+
* window to `auth.oxy.so`. See `allowsAutomaticIdpRedirect`.
|
|
107
|
+
* @default 'redirect'
|
|
108
|
+
*/
|
|
109
|
+
webAuthMode?: WebAuthMode;
|
|
87
110
|
sessionClient: SessionClient;
|
|
88
111
|
syncDeviceCredentialToHost: () => Promise<void>;
|
|
89
|
-
commitSession: (
|
|
112
|
+
commitSession: (
|
|
113
|
+
input: CommitInput,
|
|
114
|
+
options: { activate: boolean; hubSync?: boolean },
|
|
115
|
+
) => Promise<void>;
|
|
90
116
|
markAuthResolved: () => void;
|
|
91
117
|
setTokenReady: (ready: boolean) => void;
|
|
92
118
|
}
|
|
@@ -95,19 +121,19 @@ export interface RunProviderColdBootOptions {
|
|
|
95
121
|
* Device-first cold boot for `@oxyhq/services` providers.
|
|
96
122
|
*
|
|
97
123
|
* Ordered pipeline:
|
|
98
|
-
* 1. Complete
|
|
124
|
+
* 1. Complete OAuth authorization-code return (web)
|
|
99
125
|
* 2. `runSessionColdBoot` — device-secret mint (+ native shared-key, or the
|
|
100
126
|
* primary-identity-key lane in `sessionMode: 'identity'`)
|
|
127
|
+
* 3. Silent OAuth for all web apps when mint finds no session
|
|
101
128
|
*
|
|
102
|
-
*
|
|
103
|
-
* which for an identity-bound client is somebody else's account by
|
|
104
|
-
* In `'identity'` mode the boot is exactly step 2.
|
|
129
|
+
* Steps 1 and 3 are ACCOUNT-MODE ONLY: both commit whichever account the IdP
|
|
130
|
+
* resolves, which for an identity-bound client is somebody else's account by
|
|
131
|
+
* construction. In `'identity'` mode the boot is exactly step 2.
|
|
105
132
|
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
* navigation — it only consumes a code that is already in the address bar.
|
|
133
|
+
* Step 3 is additionally REDIRECT-MODE ONLY: it navigates the top-level window
|
|
134
|
+
* with no user gesture behind it, which `webAuthMode: 'popup'` exists to
|
|
135
|
+
* eliminate. In popup mode the boot is steps 1 and 2, and a domain with no local
|
|
136
|
+
* credential simply resolves signed out. See `allowsAutomaticIdpRedirect`.
|
|
111
137
|
*/
|
|
112
138
|
export async function runProviderColdBoot(opts: RunProviderColdBootOptions): Promise<void> {
|
|
113
139
|
const {
|
|
@@ -115,8 +141,10 @@ export async function runProviderColdBoot(opts: RunProviderColdBootOptions): Pro
|
|
|
115
141
|
authStore,
|
|
116
142
|
clientId,
|
|
117
143
|
authRedirectUri,
|
|
144
|
+
authorizeBaseUrl,
|
|
118
145
|
sessionMode = 'account',
|
|
119
146
|
identity,
|
|
147
|
+
webAuthMode = 'redirect',
|
|
120
148
|
sessionClient,
|
|
121
149
|
syncDeviceCredentialToHost,
|
|
122
150
|
commitSession,
|
|
@@ -129,19 +157,28 @@ export async function runProviderColdBoot(opts: RunProviderColdBootOptions): Pro
|
|
|
129
157
|
setTokenReady(false);
|
|
130
158
|
|
|
131
159
|
try {
|
|
132
|
-
//
|
|
133
|
-
//
|
|
134
|
-
//
|
|
135
|
-
//
|
|
136
|
-
//
|
|
137
|
-
// URL via `history.replaceState
|
|
160
|
+
// MODE-INDEPENDENT URL cleanup, deliberately so: both consume query params a
|
|
161
|
+
// PREVIOUS redirect-mode session left in the address bar (`?error=login_required`
|
|
162
|
+
// from a silent authorize, `?hub_sync=failed` from the hub) and restore the
|
|
163
|
+
// page the visit started on. Flipping an app to popup mode must not strand
|
|
164
|
+
// those params, so neither is gated on `webAuthMode`. Neither starts a
|
|
165
|
+
// navigation — they only rewrite the URL via `history.replaceState`.
|
|
166
|
+
consumeSilentOAuthError();
|
|
167
|
+
consumeHubSyncFailure();
|
|
168
|
+
|
|
169
|
+
// The redirect transport's RETURN leg — also NOT gated on `webAuthMode`. A
|
|
170
|
+
// popup-mode app legitimately lands here with `?code=` whenever the browser
|
|
171
|
+
// blocked the popup and `startWebOAuthSignIn` fell back to a full-page
|
|
172
|
+
// redirect (`popup-blocked` / `popup-navigation-failed`), and an app that
|
|
173
|
+
// switched modes mid-flight must not be stranded with a dead `?code=`
|
|
174
|
+
// either. It consumes a code already on the URL; it never starts one.
|
|
138
175
|
const oauthCompleted = identityBound
|
|
139
176
|
? false
|
|
140
177
|
: await tryCompleteOAuthReturn({
|
|
141
178
|
oxyServices,
|
|
142
179
|
clientId,
|
|
143
180
|
authRedirectUri,
|
|
144
|
-
commitSession: (input) => commitSession(input, { activate: true }),
|
|
181
|
+
commitSession: (input) => commitSession(input, { activate: true, hubSync: false }),
|
|
145
182
|
});
|
|
146
183
|
if (oauthCompleted) {
|
|
147
184
|
setTokenReady(true);
|
|
@@ -155,7 +192,7 @@ export async function runProviderColdBoot(opts: RunProviderColdBootOptions): Pro
|
|
|
155
192
|
// resolves to "online" — the network steps still run.
|
|
156
193
|
const offline = await detectOfflineHint();
|
|
157
194
|
|
|
158
|
-
await runSessionColdBoot({
|
|
195
|
+
const outcome = await runSessionColdBoot({
|
|
159
196
|
oxy: oxyServices,
|
|
160
197
|
store: authStore,
|
|
161
198
|
platform: { isWeb: isWebBrowser(), isNative: !isWebBrowser() },
|
|
@@ -222,6 +259,46 @@ export async function runProviderColdBoot(opts: RunProviderColdBootOptions): Pro
|
|
|
222
259
|
}
|
|
223
260
|
},
|
|
224
261
|
});
|
|
262
|
+
|
|
263
|
+
// Silent cross-origin OAuth restore (web cross-app SSO): a full-page
|
|
264
|
+
// `prompt=none` bounce to the IdP when the mint found no local session.
|
|
265
|
+
//
|
|
266
|
+
// TRANSPORT gate (`allowsAutomaticIdpRedirect`): `webAuthMode: 'popup'`
|
|
267
|
+
// FORBIDS this lane. It navigates the top-level window with no user gesture
|
|
268
|
+
// behind it, which is precisely what popup mode exists to eliminate — a
|
|
269
|
+
// popup-mode domain without a local credential resolves signed out right
|
|
270
|
+
// here and waits for the user's next explicit "Continue with Oxy" (issue
|
|
271
|
+
// #691, "Cold boot and cross-domain behavior"). `'redirect'` — still the
|
|
272
|
+
// default and the compatibility path — reaches this lane unchanged, and this
|
|
273
|
+
// whole block disappears with the transport in phase 7b.
|
|
274
|
+
//
|
|
275
|
+
// ORIGIN gate: same as the hub-sync WRITE side (`syncHubAfterSignIn`) —
|
|
276
|
+
// official web origins only, never the IdP hub itself, and — unlike the
|
|
277
|
+
// write side — never a loopback / local-dev origin (which must not be
|
|
278
|
+
// bounced to a hosted IdP on cold boot). The authorize endpoint is
|
|
279
|
+
// env-configurable so a local/staging app targets its own IdP instead of
|
|
280
|
+
// production.
|
|
281
|
+
const webOrigin = isWebBrowser()
|
|
282
|
+
? (globalThis as { location?: Location }).location?.origin
|
|
283
|
+
: undefined;
|
|
284
|
+
if (
|
|
285
|
+
!identityBound &&
|
|
286
|
+
allowsAutomaticIdpRedirect(webAuthMode) &&
|
|
287
|
+
clientId &&
|
|
288
|
+
outcome.kind !== 'session' &&
|
|
289
|
+
webOrigin &&
|
|
290
|
+
isSilentRestoreEligibleOrigin(webOrigin)
|
|
291
|
+
) {
|
|
292
|
+
const redirected = await maybeStartSilentOAuthRestore({
|
|
293
|
+
oxyServices,
|
|
294
|
+
clientId,
|
|
295
|
+
redirectUri: authRedirectUri,
|
|
296
|
+
authorizeBaseUrl,
|
|
297
|
+
});
|
|
298
|
+
if (redirected) {
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
225
302
|
} catch (error) {
|
|
226
303
|
if (__DEV__) {
|
|
227
304
|
loggerUtil.error(
|
|
@@ -6,7 +6,7 @@ import type {
|
|
|
6
6
|
StyleProp,
|
|
7
7
|
} from 'react-native';
|
|
8
8
|
import { useOxy } from '../context/OxyContext';
|
|
9
|
-
import { toast } from '@oxyhq/bloom
|
|
9
|
+
import { toast } from '@oxyhq/bloom';
|
|
10
10
|
import { Button } from '@oxyhq/bloom/button';
|
|
11
11
|
import { Loading } from '@oxyhq/bloom/loading';
|
|
12
12
|
import { useFollow, useFollowForButton } from '../hooks/useFollow';
|
|
@@ -75,19 +75,7 @@ const OxyAccountDialogScreen: React.FC<BaseScreenProps> = ({ canGoBack }) => {
|
|
|
75
75
|
const { view } = snapshot;
|
|
76
76
|
const showBack =
|
|
77
77
|
view === 'qr' || view === 'signup' || (view === 'add' && snapshot.accounts.length > 0);
|
|
78
|
-
const goToAccounts = useCallback(() =>
|
|
79
|
-
if (!controller) return;
|
|
80
|
-
const { view: currentView, signIn } = controller.getSnapshot();
|
|
81
|
-
// Backing out of an active request must withdraw it — otherwise the
|
|
82
|
-
// authorizeCode stays approvable until expiry (issue #691 phase 5).
|
|
83
|
-
if (
|
|
84
|
-
(currentView === 'qr' || currentView === 'add') &&
|
|
85
|
-
(signIn.phase === 'starting' || signIn.phase === 'waiting')
|
|
86
|
-
) {
|
|
87
|
-
controller.cancelSignIn();
|
|
88
|
-
}
|
|
89
|
-
controller.setView('accounts');
|
|
90
|
-
}, [controller]);
|
|
78
|
+
const goToAccounts = useCallback(() => controller?.setView('accounts'), [controller]);
|
|
91
79
|
// An ENTRY view (accounts / signin — no in-dialog back of its own) that is
|
|
92
80
|
// MORPHED into a host surface (ManageAccount → switcher) has a frame beneath it,
|
|
93
81
|
// so its back CLOSES the dialog and reshapes back to the host — routed through
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
import type React from 'react';
|
|
37
37
|
import { useCallback, useMemo, useState, useSyncExternalStore } from 'react';
|
|
38
38
|
import { Linking, Platform } from 'react-native';
|
|
39
|
-
import { toast } from '@oxyhq/bloom
|
|
39
|
+
import { toast } from '@oxyhq/bloom';
|
|
40
40
|
import { useTheme } from '@oxyhq/bloom/theme';
|
|
41
41
|
import type { AccountDialogSnapshot } from '@oxyhq/core';
|
|
42
42
|
import { isOxyRpOrigin } from '@oxyhq/core';
|
|
@@ -72,13 +72,6 @@ const ACCOUNTS_APP_URL = 'https://accounts.oxy.so';
|
|
|
72
72
|
export interface OxyAuthChooserProps {
|
|
73
73
|
/** Called after a completed switch, sign-in, or sign-up. */
|
|
74
74
|
onComplete?: () => void;
|
|
75
|
-
/**
|
|
76
|
-
* When false, the web sign-in entry does not auto-start a device-flow
|
|
77
|
-
* session on mount. Use for hosts (e.g. the cross-origin passkey hub) that
|
|
78
|
-
* already have a pending `authorizeCode` and must not spawn a second one.
|
|
79
|
-
* @default true
|
|
80
|
-
*/
|
|
81
|
-
autoStartSignIn?: boolean;
|
|
82
75
|
}
|
|
83
76
|
|
|
84
77
|
/**
|
|
@@ -86,10 +79,7 @@ export interface OxyAuthChooserProps {
|
|
|
86
79
|
* (wrapped in Bloom's `<Dialog>`) today; mountable bare by any future host that
|
|
87
80
|
* supplies its own `onComplete`.
|
|
88
81
|
*/
|
|
89
|
-
const OxyAuthChooser: React.FC<OxyAuthChooserProps> = ({
|
|
90
|
-
onComplete,
|
|
91
|
-
autoStartSignIn: autoStartSignInEnabled = true,
|
|
92
|
-
}) => {
|
|
82
|
+
const OxyAuthChooser: React.FC<OxyAuthChooserProps> = ({ onComplete }) => {
|
|
93
83
|
const {
|
|
94
84
|
accountDialogController: controller,
|
|
95
85
|
showBottomSheet,
|
|
@@ -171,11 +161,11 @@ const OxyAuthChooser: React.FC<OxyAuthChooserProps> = ({
|
|
|
171
161
|
// a no-op on native (button-driven). Reads the live snapshot at call time (an
|
|
172
162
|
// event callback, not render), so it is stable across renders.
|
|
173
163
|
const autoStartSignIn = useCallback(() => {
|
|
174
|
-
if (!
|
|
164
|
+
if (!controller || !isWebBrowser()) return;
|
|
175
165
|
const { view: currentView, signIn } = controller.getSnapshot();
|
|
176
166
|
if ((currentView !== 'signin' && currentView !== 'add') || signIn.phase !== 'idle') return;
|
|
177
167
|
void controller.signInWithOxy();
|
|
178
|
-
}, [
|
|
168
|
+
}, [controller]);
|
|
179
169
|
|
|
180
170
|
// Bind the headless controller. `getSnapshot` returns a stable reference
|
|
181
171
|
// between changes, so it is `useSyncExternalStore`-safe. Guard the no-provider
|
|
@@ -5,14 +5,13 @@ import { SafeAreaProvider } from 'react-native-safe-area-context';
|
|
|
5
5
|
import type { OxyProviderProps } from '../types/navigation';
|
|
6
6
|
import { OxyContextProvider, type OxyContextProviderProps } from '../context/OxyContext';
|
|
7
7
|
import { QueryClientProvider, focusManager, onlineManager } from '@tanstack/react-query';
|
|
8
|
-
import { BloomDialogProvider } from '@oxyhq/bloom
|
|
8
|
+
import { BloomDialogProvider } from '@oxyhq/bloom';
|
|
9
9
|
import { SurfaceProvider } from '@oxyhq/bloom/surfaces';
|
|
10
10
|
import { ToastOutlet } from '@oxyhq/bloom/toast';
|
|
11
11
|
import { logger as loggerUtil } from '@oxyhq/core';
|
|
12
12
|
import { RequireOxyAuth } from './RequireOxyAuth';
|
|
13
13
|
import { attachQueryPersistence, createQueryClient } from '../hooks/queryClient';
|
|
14
14
|
import { createPlatformStorage, type StorageInterface } from '../utils/storageHelpers';
|
|
15
|
-
import { isNetConnectivityOnline } from '../utils/netConnectivity';
|
|
16
15
|
|
|
17
16
|
/**
|
|
18
17
|
* Background color shown for the brief window between mount and the
|
|
@@ -93,10 +92,10 @@ const OxyProvider: FC<OxyProviderProps> = ({
|
|
|
93
92
|
authRedirectUri,
|
|
94
93
|
authorizeBaseUrl,
|
|
95
94
|
sessionMode = 'account',
|
|
96
|
-
webAuthMode = '
|
|
95
|
+
webAuthMode = 'redirect',
|
|
97
96
|
queryClient: providedQueryClient,
|
|
98
97
|
requireAuth = 'off',
|
|
99
|
-
|
|
98
|
+
hubSync = true,
|
|
100
99
|
}) => {
|
|
101
100
|
|
|
102
101
|
// Dynamic KeyboardProvider for native. Uses variable indirection
|
|
@@ -231,10 +230,10 @@ const OxyProvider: FC<OxyProviderProps> = ({
|
|
|
231
230
|
try {
|
|
232
231
|
const NetInfo = await import('@react-native-community/netinfo');
|
|
233
232
|
const state = await NetInfo.default.fetch();
|
|
234
|
-
onlineManager.setOnline(
|
|
233
|
+
onlineManager.setOnline(state.isConnected ?? true);
|
|
235
234
|
|
|
236
|
-
const unsubscribe = NetInfo.default.addEventListener((state: { isConnected: boolean | null
|
|
237
|
-
onlineManager.setOnline(
|
|
235
|
+
const unsubscribe = NetInfo.default.addEventListener((state: { isConnected: boolean | null }) => {
|
|
236
|
+
onlineManager.setOnline(state.isConnected ?? true);
|
|
238
237
|
});
|
|
239
238
|
|
|
240
239
|
cleanup = () => unsubscribe();
|
|
@@ -294,7 +293,7 @@ const OxyProvider: FC<OxyProviderProps> = ({
|
|
|
294
293
|
clientId={clientId}
|
|
295
294
|
sessionMode={sessionMode}
|
|
296
295
|
webAuthMode={webAuthMode}
|
|
297
|
-
|
|
296
|
+
hubSync={hubSync}
|
|
298
297
|
onAuthStateChange={onAuthStateChange as OxyContextProviderProps['onAuthStateChange']}
|
|
299
298
|
>
|
|
300
299
|
<SurfaceProvider>
|
|
@@ -13,7 +13,7 @@ import { Avatar } from '@oxyhq/bloom/avatar';
|
|
|
13
13
|
import * as Skeleton from '@oxyhq/bloom/skeleton';
|
|
14
14
|
import { Text } from '@oxyhq/bloom/typography';
|
|
15
15
|
import { useTheme } from '@oxyhq/bloom/theme';
|
|
16
|
-
import { getAccountDisplayName, getAccountFallbackHandle
|
|
16
|
+
import { getAccountDisplayName, getAccountFallbackHandle } from '@oxyhq/core';
|
|
17
17
|
import { useAuth } from '../hooks/useAuth';
|
|
18
18
|
import { useOxy } from '../context/OxyContext';
|
|
19
19
|
import { useI18n } from '../hooks/useI18n';
|
|
@@ -201,10 +201,7 @@ const ProfileButton: React.FC<ProfileButtonProps> = ({
|
|
|
201
201
|
}
|
|
202
202
|
|
|
203
203
|
// ── Signed in: avatar + identity + chevron. ─────────────────────────────
|
|
204
|
-
const displayName =
|
|
205
|
-
user?.name?.displayName ??
|
|
206
|
-
getNormalizedUserHandle(user) ??
|
|
207
|
-
getAccountDisplayName(null, locale);
|
|
204
|
+
const displayName = getAccountDisplayName(user, locale);
|
|
208
205
|
const handle = getAccountFallbackHandle(user);
|
|
209
206
|
const handleLine = handle ? `@${handle}` : null;
|
|
210
207
|
|