@oxyhq/services 26.0.1 → 26.0.4
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 +21 -127
- package/android/src/main/java/so/oxy/session/OxyBackgroundSession.kt +184 -0
- package/android/src/main/java/so/oxy/session/OxyBackgroundSessionApi.kt +162 -0
- package/android/src/main/java/so/oxy/session/OxyBackgroundSessionModule.kt +116 -0
- package/android/src/main/java/so/oxy/session/OxyBackgroundSessionStore.kt +179 -0
- package/android/src/main/java/so/oxy/session/OxyBackgroundToken.kt +61 -0
- package/android/src/main/java/so/oxy/storage/OxyEncryptedPrefs.kt +241 -0
- package/expo-module.config.json +4 -1
- package/lib/commonjs/index.js +18 -49
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/notifications/deviceNotifications.js +63 -0
- package/lib/commonjs/notifications/deviceNotifications.js.map +1 -1
- 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 +2 -2
- package/lib/commonjs/ui/components/AvatarCameraBadge.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 +13 -1
- package/lib/commonjs/ui/components/OxyAccountDialogScreen.js.map +1 -1
- package/lib/commonjs/ui/components/OxyAuthChooser.js +29 -24
- package/lib/commonjs/ui/components/OxyAuthChooser.js.map +1 -1
- package/lib/commonjs/ui/components/OxyProvider.js +8 -7
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/components/OxySignInButton.js.map +1 -1
- package/lib/commonjs/ui/components/ProfileButton.js +20 -26
- package/lib/commonjs/ui/components/ProfileButton.js.map +1 -1
- package/lib/commonjs/ui/components/authChooser/AccountsMenuView.js +68 -58
- package/lib/commonjs/ui/components/authChooser/AccountsMenuView.js.map +1 -1
- package/lib/commonjs/ui/components/authChooser/types.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 +3 -1
- 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 +32 -46
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/context/commitSessionFlow.js +3 -43
- package/lib/commonjs/ui/context/commitSessionFlow.js.map +1 -1
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js +15 -2
- package/lib/commonjs/ui/context/hooks/useAuthOperations.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/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 +3 -2
- 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 +8 -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 +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/hooks/useSettingToggle.js +4 -4
- package/lib/commonjs/ui/hooks/useSettingToggle.js.map +1 -1
- package/lib/commonjs/ui/hooks/useSurfaceHeader.js +68 -11
- package/lib/commonjs/ui/hooks/useSurfaceHeader.js.map +1 -1
- package/lib/commonjs/ui/navigation/accountDialogManager.js +2 -0
- package/lib/commonjs/ui/navigation/accountDialogManager.js.map +1 -1
- package/lib/commonjs/ui/oauth/browserAuthTransport.js +66 -64
- package/lib/commonjs/ui/oauth/browserAuthTransport.js.map +1 -1
- package/lib/commonjs/ui/oauth/oauthPopup.js +47 -0
- 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 +41 -19
- 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 +6 -7
- 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 +46 -14
- package/lib/commonjs/ui/screens/CreateAccountScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js +5 -5
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/EditProfileScreen.js +2 -3
- 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 +90 -89
- 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 +9 -34
- 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 +17 -7
- 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 +13 -7
- package/lib/commonjs/ui/screens/UserListScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js +5 -6
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/fileManagement/PhotoPickerSection.js +1 -4
- package/lib/commonjs/ui/screens/fileManagement/PhotoPickerSection.js.map +1 -1
- package/lib/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.js +34 -24
- 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 +3 -4
- 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/backgroundSession.js +258 -0
- package/lib/commonjs/ui/session/backgroundSession.js.map +1 -0
- package/lib/commonjs/ui/session/index.js +7 -0
- package/lib/commonjs/ui/session/index.js.map +1 -1
- package/lib/commonjs/ui/session/useBackgroundSessionSync.js +81 -0
- package/lib/commonjs/ui/session/useBackgroundSessionSync.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/netConnectivity.js +28 -0
- package/lib/commonjs/ui/utils/netConnectivity.js.map +1 -0
- package/lib/commonjs/ui/utils/oauthReturn.js +19 -30
- package/lib/commonjs/ui/utils/oauthReturn.js.map +1 -1
- package/lib/commonjs/ui/utils/userUtils.js +27 -28
- package/lib/commonjs/ui/utils/userUtils.js.map +1 -1
- package/lib/module/index.js +20 -8
- package/lib/module/index.js.map +1 -1
- package/lib/module/notifications/deviceNotifications.js +62 -0
- package/lib/module/notifications/deviceNotifications.js.map +1 -1
- 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/FollowButton.js +1 -1
- package/lib/module/ui/components/FollowButton.js.map +1 -1
- package/lib/module/ui/components/OxyAccountDialogScreen.js +13 -1
- package/lib/module/ui/components/OxyAccountDialogScreen.js.map +1 -1
- package/lib/module/ui/components/OxyAuthChooser.js +25 -20
- package/lib/module/ui/components/OxyAuthChooser.js.map +1 -1
- package/lib/module/ui/components/OxyProvider.js +7 -6
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/components/OxySignInButton.js.map +1 -1
- package/lib/module/ui/components/ProfileButton.js +12 -18
- package/lib/module/ui/components/ProfileButton.js.map +1 -1
- package/lib/module/ui/components/authChooser/AccountsMenuView.js +68 -58
- package/lib/module/ui/components/authChooser/AccountsMenuView.js.map +1 -1
- package/lib/module/ui/components/authChooser/types.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 +3 -1
- 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 +35 -49
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/context/commitSessionFlow.js +3 -42
- package/lib/module/ui/context/commitSessionFlow.js.map +1 -1
- package/lib/module/ui/context/hooks/useAuthOperations.js +15 -2
- package/lib/module/ui/context/hooks/useAuthOperations.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/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 +3 -2
- 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 +8 -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 +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/hooks/useSettingToggle.js +1 -1
- package/lib/module/ui/hooks/useSettingToggle.js.map +1 -1
- package/lib/module/ui/hooks/useSurfaceHeader.js +68 -11
- package/lib/module/ui/hooks/useSurfaceHeader.js.map +1 -1
- package/lib/module/ui/navigation/accountDialogManager.js +2 -0
- package/lib/module/ui/navigation/accountDialogManager.js.map +1 -1
- package/lib/module/ui/oauth/browserAuthTransport.js +66 -64
- package/lib/module/ui/oauth/browserAuthTransport.js.map +1 -1
- package/lib/module/ui/oauth/oauthPopup.js +48 -1
- 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 +37 -15
- 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 +4 -5
- 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 +45 -13
- package/lib/module/ui/screens/CreateAccountScreen.js.map +1 -1
- package/lib/module/ui/screens/EditProfileFieldScreen.js +4 -4
- package/lib/module/ui/screens/EditProfileFieldScreen.js.map +1 -1
- package/lib/module/ui/screens/EditProfileScreen.js +3 -4
- 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 +94 -91
- 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 +5 -30
- 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 +18 -8
- 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 +14 -8
- 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/PhotoPickerSection.js +1 -4
- package/lib/module/ui/screens/fileManagement/PhotoPickerSection.js.map +1 -1
- package/lib/module/ui/screens/fileManagement/hooks/useFileUploadState.js +15 -5
- 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 +4 -5
- 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/backgroundSession.js +252 -0
- package/lib/module/ui/session/backgroundSession.js.map +1 -0
- package/lib/module/ui/session/index.js +1 -0
- package/lib/module/ui/session/index.js.map +1 -1
- package/lib/module/ui/session/useBackgroundSessionSync.js +76 -0
- package/lib/module/ui/session/useBackgroundSessionSync.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/netConnectivity.js +23 -0
- package/lib/module/ui/utils/netConnectivity.js.map +1 -0
- package/lib/module/ui/utils/oauthReturn.js +20 -30
- package/lib/module/ui/utils/oauthReturn.js.map +1 -1
- package/lib/module/ui/utils/userUtils.js +27 -28
- package/lib/module/ui/utils/userUtils.js.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +1 -2
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/notifications/deviceNotifications.d.ts +51 -0
- package/lib/typescript/commonjs/notifications/deviceNotifications.d.ts.map +1 -1
- 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/AvatarCameraBadge.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 +7 -0
- 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/OxySignInButton.d.ts +2 -1
- package/lib/typescript/commonjs/ui/components/OxySignInButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/ProfileButton.d.ts +3 -0
- 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/types.d.ts +6 -0
- package/lib/typescript/commonjs/ui/components/authChooser/types.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 +0 -40
- package/lib/typescript/commonjs/ui/context/commitSessionFlow.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/hooks/useAuthOperations.d.ts +11 -2
- package/lib/typescript/commonjs/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/oxyContextTypes.d.ts +26 -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/mutations/useAccountMutations.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/paymentTypes.d.ts +3 -2
- package/lib/typescript/commonjs/ui/hooks/queries/paymentTypes.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/usePaymentQueries.d.ts +3 -2
- 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 +10 -6
- 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/hooks/useSurfaceHeader.d.ts +7 -2
- package/lib/typescript/commonjs/ui/hooks/useSurfaceHeader.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/navigation/accountDialogManager.d.ts +8 -0
- package/lib/typescript/commonjs/ui/navigation/accountDialogManager.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/oauth/browserAuthTransport.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/oauth/oauthPopup.d.ts +6 -0
- package/lib/typescript/commonjs/ui/oauth/oauthPopup.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/ChangeAvatarScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/CreateAccountScreen.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 +3 -0
- package/lib/typescript/commonjs/ui/screens/FollowersListScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/FollowingListScreen.d.ts +3 -0
- 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 +7 -0
- 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/backgroundSession.d.ts +42 -0
- package/lib/typescript/commonjs/ui/session/backgroundSession.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/session/index.d.ts +1 -0
- package/lib/typescript/commonjs/ui/session/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/session/useBackgroundSessionSync.d.ts +23 -0
- package/lib/typescript/commonjs/ui/session/useBackgroundSessionSync.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/types/navigation.d.ts +27 -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/commonjs/ui/utils/userUtils.d.ts +7 -14
- package/lib/typescript/commonjs/ui/utils/userUtils.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +1 -2
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/notifications/deviceNotifications.d.ts +51 -0
- package/lib/typescript/module/notifications/deviceNotifications.d.ts.map +1 -1
- 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/AvatarCameraBadge.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 +7 -0
- 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/OxySignInButton.d.ts +2 -1
- package/lib/typescript/module/ui/components/OxySignInButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/ProfileButton.d.ts +3 -0
- 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/types.d.ts +6 -0
- package/lib/typescript/module/ui/components/authChooser/types.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 +0 -40
- package/lib/typescript/module/ui/context/commitSessionFlow.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/hooks/useAuthOperations.d.ts +11 -2
- package/lib/typescript/module/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/oxyContextTypes.d.ts +26 -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/mutations/useAccountMutations.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/queries/paymentTypes.d.ts +3 -2
- package/lib/typescript/module/ui/hooks/queries/paymentTypes.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/queries/usePaymentQueries.d.ts +3 -2
- 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 +10 -6
- 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/hooks/useSurfaceHeader.d.ts +7 -2
- package/lib/typescript/module/ui/hooks/useSurfaceHeader.d.ts.map +1 -1
- package/lib/typescript/module/ui/navigation/accountDialogManager.d.ts +8 -0
- package/lib/typescript/module/ui/navigation/accountDialogManager.d.ts.map +1 -1
- package/lib/typescript/module/ui/oauth/browserAuthTransport.d.ts.map +1 -1
- package/lib/typescript/module/ui/oauth/oauthPopup.d.ts +6 -0
- package/lib/typescript/module/ui/oauth/oauthPopup.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/ChangeAvatarScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/CreateAccountScreen.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 +3 -0
- package/lib/typescript/module/ui/screens/FollowersListScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/FollowingListScreen.d.ts +3 -0
- 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 +7 -0
- 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/backgroundSession.d.ts +42 -0
- package/lib/typescript/module/ui/session/backgroundSession.d.ts.map +1 -0
- package/lib/typescript/module/ui/session/index.d.ts +1 -0
- package/lib/typescript/module/ui/session/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/session/useBackgroundSessionSync.d.ts +23 -0
- package/lib/typescript/module/ui/session/useBackgroundSessionSync.d.ts.map +1 -0
- package/lib/typescript/module/ui/types/navigation.d.ts +27 -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/lib/typescript/module/ui/utils/userUtils.d.ts +7 -14
- package/lib/typescript/module/ui/utils/userUtils.d.ts.map +1 -1
- package/lib/typescript/types/expo-image-picker.d.ts +35 -0
- package/package.json +32 -12
- package/src/index.ts +19 -16
- package/src/notifications/deviceNotifications.ts +82 -0
- package/src/types/expo-image-picker.d.ts +35 -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 +2 -1
- package/src/ui/components/FollowButton.tsx +1 -1
- package/src/ui/components/OxyAccountDialogScreen.tsx +13 -1
- package/src/ui/components/OxyAuthChooser.tsx +31 -20
- package/src/ui/components/OxyProvider.tsx +8 -7
- package/src/ui/components/OxySignInButton.tsx +2 -1
- package/src/ui/components/ProfileButton.tsx +15 -20
- package/src/ui/components/authChooser/AccountsMenuView.tsx +66 -57
- package/src/ui/components/authChooser/types.ts +6 -0
- 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 +1 -0
- 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 +35 -46
- package/src/ui/context/__tests__/commitSessionFlow.test.ts +13 -89
- package/src/ui/context/commitSessionFlow.ts +3 -61
- package/src/ui/context/hooks/useAuthOperations.ts +26 -1
- package/src/ui/context/oxyContextTypes.ts +26 -7
- 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 +3 -2
- package/src/ui/hooks/queries/usePaymentQueries.ts +3 -2
- package/src/ui/hooks/queries/userCache.ts +169 -148
- package/src/ui/hooks/useAssets.ts +1 -1
- package/src/ui/hooks/useAsyncAction.ts +3 -3
- package/src/ui/hooks/useAuth.ts +12 -6
- package/src/ui/hooks/useAvatarPicker.ts +1 -1
- package/src/ui/hooks/useOnlineStatus.ts +3 -2
- package/src/ui/hooks/useSessionManagement.ts +0 -2
- package/src/ui/hooks/useSettingToggle.ts +1 -1
- package/src/ui/hooks/useSurfaceHeader.ts +90 -15
- package/src/ui/navigation/accountDialogManager.ts +9 -0
- package/src/ui/oauth/__tests__/oauthPopup.test.ts +26 -0
- package/src/ui/oauth/browserAuthTransport.ts +55 -49
- package/src/ui/oauth/oauthPopup.ts +61 -3
- package/src/ui/screens/AccountMembersScreen.tsx +1 -1
- package/src/ui/screens/AccountSettingsScreen.tsx +45 -17
- 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 +7 -4
- package/src/ui/screens/ConnectedAppsScreen.tsx +2 -2
- package/src/ui/screens/CreateAccountScreen.tsx +55 -15
- package/src/ui/screens/EditProfileFieldScreen.tsx +4 -4
- package/src/ui/screens/EditProfileScreen.tsx +6 -3
- package/src/ui/screens/FAQScreen.tsx +1 -1
- package/src/ui/screens/FeedbackScreen.tsx +741 -575
- package/src/ui/screens/FileManagementScreen.tsx +1 -1
- package/src/ui/screens/FollowersListScreen.tsx +3 -0
- package/src/ui/screens/FollowingListScreen.tsx +3 -0
- package/src/ui/screens/HelpSupportScreen.tsx +1 -1
- package/src/ui/screens/HistoryViewScreen.tsx +5 -20
- package/src/ui/screens/LanguageSelectorScreen.tsx +1 -1
- package/src/ui/screens/LegalDocumentsScreen.tsx +1 -1
- package/src/ui/screens/ManageAccountScreen.tsx +9 -2
- package/src/ui/screens/PremiumSubscriptionScreen.tsx +4 -4
- package/src/ui/screens/PrivacySettingsScreen.tsx +15 -12
- package/src/ui/screens/ProfileScreen.tsx +24 -6
- package/src/ui/screens/SavesCollectionsScreen.tsx +1 -1
- package/src/ui/screens/UserListScreen.tsx +18 -8
- 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 +14 -5
- package/src/ui/screens/trust/TrustCenterScreen.tsx +2 -2
- package/src/ui/screens/trust/TrustLeaderboardScreen.tsx +6 -5
- 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/__tests__/backgroundSession.test.ts +392 -0
- package/src/ui/session/backgroundSession.ts +313 -0
- package/src/ui/session/index.ts +1 -0
- package/src/ui/session/useBackgroundSessionSync.ts +92 -0
- package/src/ui/types/navigation.ts +27 -19
- package/src/ui/utils/fileManagement.ts +108 -92
- package/src/ui/utils/netConnectivity.ts +27 -0
- package/src/ui/utils/oauthReturn.ts +23 -33
- package/src/ui/utils/userUtils.ts +27 -32
- 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 -143
- package/src/ui/utils/crossOriginRestore.ts +0 -169
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
declare module 'expo-image-picker' {
|
|
2
|
+
export interface ImagePickerAsset {
|
|
3
|
+
uri: string;
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface ImagePickerSuccessResult {
|
|
9
|
+
canceled: false;
|
|
10
|
+
assets: ImagePickerAsset[];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface ImagePickerCanceledResult {
|
|
14
|
+
canceled: true;
|
|
15
|
+
assets: null;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export type ImagePickerResult = ImagePickerSuccessResult | ImagePickerCanceledResult;
|
|
19
|
+
|
|
20
|
+
export interface ImagePickerPermission {
|
|
21
|
+
granted: boolean;
|
|
22
|
+
canAskAgain: boolean;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface ImagePickerOptions {
|
|
26
|
+
mediaTypes?: 'images'[];
|
|
27
|
+
allowsMultipleSelection?: boolean;
|
|
28
|
+
quality?: number;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function launchImageLibraryAsync(options?: ImagePickerOptions): Promise<ImagePickerResult>;
|
|
32
|
+
export function launchCameraAsync(options?: ImagePickerOptions): Promise<ImagePickerResult>;
|
|
33
|
+
export function requestMediaLibraryPermissionsAsync(): Promise<ImagePickerPermission>;
|
|
34
|
+
export function requestCameraPermissionsAsync(): Promise<ImagePickerPermission>;
|
|
35
|
+
}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `runProviderColdBoot` — the boot NEVER navigates the top-level window (#691
|
|
3
|
+
* phase 7b).
|
|
4
|
+
*
|
|
5
|
+
* Phase 7b deleted the two SDK-initiated, gesture-less full-page hops to the
|
|
6
|
+
* IdP: the cold-boot `prompt=none` silent restore and the post-sign-in hub sync.
|
|
7
|
+
* A web origin with no local device credential now resolves SIGNED OUT and waits
|
|
8
|
+
* for the user's next explicit "Continue with Oxy".
|
|
9
|
+
*
|
|
10
|
+
* What must still work — and is asserted here — is everything the user actually
|
|
11
|
+
* asked for: an authorization code ALREADY on the URL is completed, which is how
|
|
12
|
+
* a browser-BLOCKED sign-in popup finishes after `startWebOAuthSignIn` falls
|
|
13
|
+
* back to a full-page redirect.
|
|
14
|
+
*
|
|
15
|
+
* Unlike `__tests__/boot/runProviderColdBoot.test.ts` (deadline + connectivity
|
|
16
|
+
* wiring), this suite keeps the real navigation primitive in view: every
|
|
17
|
+
* assertion below reaches `redirectToAuthorize`, the ONLY top-level-window
|
|
18
|
+
* navigation the boot could ever have performed.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
import type { AuthStateStore, PersistedAuthState, SessionClient } from '@oxyhq/core';
|
|
22
|
+
|
|
23
|
+
jest.mock('@oxyhq/core', () => {
|
|
24
|
+
const actual = jest.requireActual('@oxyhq/core');
|
|
25
|
+
return {
|
|
26
|
+
__esModule: true,
|
|
27
|
+
...actual,
|
|
28
|
+
runSessionColdBoot: jest.fn(),
|
|
29
|
+
};
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
// The ONLY top-level-window navigation primitive the SDK has.
|
|
33
|
+
jest.mock('../../components/oauthNavigation', () => ({
|
|
34
|
+
redirectToAuthorize: jest.fn(),
|
|
35
|
+
}));
|
|
36
|
+
|
|
37
|
+
jest.mock('../../utils/oauthReturn', () => {
|
|
38
|
+
const actual = jest.requireActual('../../utils/oauthReturn');
|
|
39
|
+
return {
|
|
40
|
+
__esModule: true,
|
|
41
|
+
...actual,
|
|
42
|
+
tryCompleteOAuthReturn: jest.fn(async () => false),
|
|
43
|
+
};
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
import { runSessionColdBoot } from '@oxyhq/core';
|
|
47
|
+
import { redirectToAuthorize } from '../../components/oauthNavigation';
|
|
48
|
+
import { tryCompleteOAuthReturn } from '../../utils/oauthReturn';
|
|
49
|
+
import { runProviderColdBoot, type RunProviderColdBootOptions } from '../runProviderColdBoot';
|
|
50
|
+
|
|
51
|
+
const mockRunSessionColdBoot = runSessionColdBoot as jest.Mock;
|
|
52
|
+
const mockRedirectToAuthorize = redirectToAuthorize as jest.Mock;
|
|
53
|
+
const mockTryCompleteOAuthReturn = tryCompleteOAuthReturn as jest.Mock;
|
|
54
|
+
|
|
55
|
+
const CLIENT_ID = 'oxy_dk_test';
|
|
56
|
+
|
|
57
|
+
/** An auth store holding no device credential — the signed-out domain case. */
|
|
58
|
+
function makeEmptyAuthStore(): AuthStateStore {
|
|
59
|
+
return {
|
|
60
|
+
load: jest.fn(async (): Promise<PersistedAuthState | null> => null),
|
|
61
|
+
save: jest.fn(async () => undefined),
|
|
62
|
+
clear: jest.fn(async () => undefined),
|
|
63
|
+
} as unknown as AuthStateStore;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
interface Harness {
|
|
67
|
+
options: RunProviderColdBootOptions;
|
|
68
|
+
commitSession: jest.Mock;
|
|
69
|
+
markAuthResolved: jest.Mock;
|
|
70
|
+
setTokenReady: jest.Mock;
|
|
71
|
+
sessionClientStart: jest.Mock;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function makeHarness(overrides: Partial<RunProviderColdBootOptions> = {}): Harness {
|
|
75
|
+
const commitSession = jest.fn(async () => undefined);
|
|
76
|
+
const markAuthResolved = jest.fn();
|
|
77
|
+
const setTokenReady = jest.fn();
|
|
78
|
+
const sessionClientStart = jest.fn(async () => undefined);
|
|
79
|
+
|
|
80
|
+
const options: RunProviderColdBootOptions = {
|
|
81
|
+
oxyServices: {} as RunProviderColdBootOptions['oxyServices'],
|
|
82
|
+
authStore: makeEmptyAuthStore(),
|
|
83
|
+
clientId: CLIENT_ID,
|
|
84
|
+
sessionClient: { start: sessionClientStart } as unknown as SessionClient,
|
|
85
|
+
syncDeviceCredentialToHost: jest.fn(async () => undefined),
|
|
86
|
+
commitSession,
|
|
87
|
+
markAuthResolved,
|
|
88
|
+
setTokenReady,
|
|
89
|
+
...overrides,
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
return { options, commitSession, markAuthResolved, setTokenReady, sessionClientStart };
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** `runSessionColdBoot` finding no session at all — the signed-out domain. */
|
|
96
|
+
function stubSignedOutBoot(): void {
|
|
97
|
+
mockRunSessionColdBoot.mockImplementation(
|
|
98
|
+
async (opts: Parameters<typeof runSessionColdBoot>[0]) => {
|
|
99
|
+
await opts.onSignedOut?.('no_session');
|
|
100
|
+
return { kind: 'unauthenticated' } as const;
|
|
101
|
+
},
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
describe('runProviderColdBoot — no SDK-initiated IdP navigation (#691 phase 7b)', () => {
|
|
106
|
+
beforeEach(() => {
|
|
107
|
+
mockRunSessionColdBoot.mockReset();
|
|
108
|
+
mockRedirectToAuthorize.mockClear();
|
|
109
|
+
mockTryCompleteOAuthReturn.mockClear();
|
|
110
|
+
mockTryCompleteOAuthReturn.mockImplementation(async () => false);
|
|
111
|
+
globalThis.sessionStorage?.clear();
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
it('resolves a domain with no local credential SIGNED OUT instead of bouncing to the IdP', async () => {
|
|
115
|
+
stubSignedOutBoot();
|
|
116
|
+
const { options, markAuthResolved, commitSession, sessionClientStart } = makeHarness();
|
|
117
|
+
|
|
118
|
+
await runProviderColdBoot(options);
|
|
119
|
+
|
|
120
|
+
// Auth resolution concluded (routing can settle), nothing was committed,
|
|
121
|
+
// and with no persisted credential the device socket is not started.
|
|
122
|
+
expect(markAuthResolved).toHaveBeenCalled();
|
|
123
|
+
expect(commitSession).not.toHaveBeenCalled();
|
|
124
|
+
expect(sessionClientStart).not.toHaveBeenCalled();
|
|
125
|
+
expect(mockRedirectToAuthorize).not.toHaveBeenCalled();
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
it('does not navigate even with a clientId configured and the mint finding nothing', async () => {
|
|
129
|
+
// The deleted silent-restore lane needed exactly this shape: a registered
|
|
130
|
+
// client id plus a signed-out mint outcome. It must now be inert.
|
|
131
|
+
stubSignedOutBoot();
|
|
132
|
+
const { options } = makeHarness({ clientId: CLIENT_ID, authRedirectUri: 'https://app.oxy.so' });
|
|
133
|
+
|
|
134
|
+
await runProviderColdBoot(options);
|
|
135
|
+
|
|
136
|
+
expect(mockRedirectToAuthorize).not.toHaveBeenCalled();
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
it('does not navigate when the mint already resolved a session', async () => {
|
|
140
|
+
mockRunSessionColdBoot.mockImplementation(
|
|
141
|
+
async (opts: Parameters<typeof runSessionColdBoot>[0]) => {
|
|
142
|
+
const session = {
|
|
143
|
+
sessionId: 's1',
|
|
144
|
+
userId: 'u1',
|
|
145
|
+
accessToken: 'at',
|
|
146
|
+
via: 'device-secret-mint',
|
|
147
|
+
};
|
|
148
|
+
await opts.onSession?.(session);
|
|
149
|
+
return { kind: 'session', via: session.via, session } as const;
|
|
150
|
+
},
|
|
151
|
+
);
|
|
152
|
+
const { options, commitSession } = makeHarness();
|
|
153
|
+
|
|
154
|
+
await runProviderColdBoot(options);
|
|
155
|
+
|
|
156
|
+
expect(commitSession).toHaveBeenCalledWith(
|
|
157
|
+
{ sessionId: 's1', accessToken: 'at', userId: 'u1' },
|
|
158
|
+
{ activate: false },
|
|
159
|
+
);
|
|
160
|
+
expect(mockRedirectToAuthorize).not.toHaveBeenCalled();
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
describe('the blocked-popup redirect fallback still completes', () => {
|
|
164
|
+
it('completes an authorization code already on the URL', async () => {
|
|
165
|
+
// A popup-mode app lands here whenever the browser blocked the popup and
|
|
166
|
+
// `startWebOAuthSignIn` fell back to a full-page redirect.
|
|
167
|
+
mockTryCompleteOAuthReturn.mockImplementation(async () => true);
|
|
168
|
+
const { options, markAuthResolved, setTokenReady } = makeHarness();
|
|
169
|
+
|
|
170
|
+
await runProviderColdBoot(options);
|
|
171
|
+
|
|
172
|
+
expect(mockTryCompleteOAuthReturn).toHaveBeenCalledTimes(1);
|
|
173
|
+
expect(setTokenReady).toHaveBeenLastCalledWith(true);
|
|
174
|
+
expect(markAuthResolved).toHaveBeenCalled();
|
|
175
|
+
// The device mint is short-circuited by the completed return leg.
|
|
176
|
+
expect(mockRunSessionColdBoot).not.toHaveBeenCalled();
|
|
177
|
+
expect(mockRedirectToAuthorize).not.toHaveBeenCalled();
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
it('runs the return leg even on a boot that finds no session', async () => {
|
|
181
|
+
stubSignedOutBoot();
|
|
182
|
+
const { options } = makeHarness();
|
|
183
|
+
|
|
184
|
+
await runProviderColdBoot(options);
|
|
185
|
+
|
|
186
|
+
expect(mockTryCompleteOAuthReturn).toHaveBeenCalledTimes(1);
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
it('commits the OAuth return as a deliberate sign-in', async () => {
|
|
190
|
+
mockTryCompleteOAuthReturn.mockImplementation(async () => true);
|
|
191
|
+
const { options } = makeHarness();
|
|
192
|
+
|
|
193
|
+
await runProviderColdBoot(options);
|
|
194
|
+
|
|
195
|
+
const commit = mockTryCompleteOAuthReturn.mock.calls[0][0] as {
|
|
196
|
+
commitSession: (input: unknown) => Promise<void>;
|
|
197
|
+
};
|
|
198
|
+
await commit.commitSession({ sessionId: 's1', userId: 'u1' });
|
|
199
|
+
expect(options.commitSession).toHaveBeenCalledWith(
|
|
200
|
+
{ sessionId: 's1', userId: 'u1' },
|
|
201
|
+
{ activate: true },
|
|
202
|
+
);
|
|
203
|
+
});
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
it('identity mode skips the web OAuth return leg entirely', async () => {
|
|
207
|
+
stubSignedOutBoot();
|
|
208
|
+
const { options } = makeHarness({ sessionMode: 'identity' });
|
|
209
|
+
|
|
210
|
+
await runProviderColdBoot(options);
|
|
211
|
+
|
|
212
|
+
expect(mockTryCompleteOAuthReturn).not.toHaveBeenCalled();
|
|
213
|
+
expect(mockRedirectToAuthorize).not.toHaveBeenCalled();
|
|
214
|
+
});
|
|
215
|
+
});
|
|
@@ -8,15 +8,9 @@ import {
|
|
|
8
8
|
} from '@oxyhq/core';
|
|
9
9
|
import type { SessionClient } from '@oxyhq/core';
|
|
10
10
|
import { loadPersistedDeviceCredential } from '../utils/deviceCredential';
|
|
11
|
-
import {
|
|
12
|
-
consumeSilentOAuthError,
|
|
13
|
-
isSilentRestoreEligibleOrigin,
|
|
14
|
-
maybeStartSilentOAuthRestore,
|
|
15
|
-
} from '../utils/crossOriginRestore';
|
|
16
|
-
import { tryCompleteOAuthReturn, consumeHubSyncFailure } from '../utils/oauthReturn';
|
|
11
|
+
import { tryCompleteOAuthReturn } from '../utils/oauthReturn';
|
|
17
12
|
import { isWebBrowser } from '../utils/isWebBrowser';
|
|
18
|
-
import {
|
|
19
|
-
import type { WebAuthMode } from '../oauth/types';
|
|
13
|
+
import { isNetConnectivityExplicitlyOffline } from '../utils/netConnectivity';
|
|
20
14
|
import type { CommitInput } from '../context/oxyContextTypes';
|
|
21
15
|
|
|
22
16
|
/** How long the cold boot waits for the post-boot SessionClient handoff (ms). */
|
|
@@ -67,8 +61,8 @@ async function detectOfflineHint(): Promise<boolean> {
|
|
|
67
61
|
}),
|
|
68
62
|
]);
|
|
69
63
|
// `null` ⇒ the probe timed out (unknown → assume online). Only an explicit
|
|
70
|
-
//
|
|
71
|
-
return state
|
|
64
|
+
// disconnected / unreachable verdict disables the network steps.
|
|
65
|
+
return isNetConnectivityExplicitlyOffline(state);
|
|
72
66
|
} catch {
|
|
73
67
|
// NetInfo missing / probe threw — never block sign-in on a probe failure.
|
|
74
68
|
return false;
|
|
@@ -80,39 +74,19 @@ export interface RunProviderColdBootOptions {
|
|
|
80
74
|
authStore: AuthStateStore;
|
|
81
75
|
clientId?: string;
|
|
82
76
|
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;
|
|
89
77
|
/**
|
|
90
78
|
* Who owns the session this boot resolves. `'account'` (the default) is the
|
|
91
79
|
* device's active account — every ordinary Oxy app. `'identity'` binds the
|
|
92
80
|
* boot to the owner of this device's PRIMARY identity key and REQUIRES
|
|
93
|
-
* {@link identity}; it also disables the
|
|
94
|
-
*
|
|
81
|
+
* {@link identity}; it also disables the web OAuth return leg below, which
|
|
82
|
+
* commits whatever account the IdP hands back.
|
|
95
83
|
*/
|
|
96
84
|
sessionMode?: SessionMode;
|
|
97
85
|
/** The identity binding required by `sessionMode: 'identity'`. */
|
|
98
86
|
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;
|
|
110
87
|
sessionClient: SessionClient;
|
|
111
88
|
syncDeviceCredentialToHost: () => Promise<void>;
|
|
112
|
-
commitSession: (
|
|
113
|
-
input: CommitInput,
|
|
114
|
-
options: { activate: boolean; hubSync?: boolean },
|
|
115
|
-
) => Promise<void>;
|
|
89
|
+
commitSession: (input: CommitInput, options: { activate: boolean }) => Promise<void>;
|
|
116
90
|
markAuthResolved: () => void;
|
|
117
91
|
setTokenReady: (ready: boolean) => void;
|
|
118
92
|
}
|
|
@@ -121,19 +95,19 @@ export interface RunProviderColdBootOptions {
|
|
|
121
95
|
* Device-first cold boot for `@oxyhq/services` providers.
|
|
122
96
|
*
|
|
123
97
|
* Ordered pipeline:
|
|
124
|
-
* 1. Complete OAuth authorization-code return (web)
|
|
98
|
+
* 1. Complete an OAuth authorization-code return already on the URL (web)
|
|
125
99
|
* 2. `runSessionColdBoot` — device-secret mint (+ native shared-key, or the
|
|
126
100
|
* primary-identity-key lane in `sessionMode: 'identity'`)
|
|
127
|
-
* 3. Silent OAuth for all web apps when mint finds no session
|
|
128
101
|
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
*
|
|
102
|
+
* Step 1 is ACCOUNT-MODE ONLY: it commits whichever account the IdP resolves,
|
|
103
|
+
* which for an identity-bound client is somebody else's account by construction.
|
|
104
|
+
* In `'identity'` mode the boot is exactly step 2.
|
|
132
105
|
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
*
|
|
106
|
+
* The boot NEVER navigates the top-level window. There is no automatic
|
|
107
|
+
* `prompt=none` bounce to the IdP: a web origin with no local device credential
|
|
108
|
+
* resolves SIGNED OUT and waits for the user's next explicit "Continue with
|
|
109
|
+
* Oxy", which opens a popup from a real gesture (#691 phase 7b). Step 1 is not a
|
|
110
|
+
* navigation — it only consumes a code that is already in the address bar.
|
|
137
111
|
*/
|
|
138
112
|
export async function runProviderColdBoot(opts: RunProviderColdBootOptions): Promise<void> {
|
|
139
113
|
const {
|
|
@@ -141,10 +115,8 @@ export async function runProviderColdBoot(opts: RunProviderColdBootOptions): Pro
|
|
|
141
115
|
authStore,
|
|
142
116
|
clientId,
|
|
143
117
|
authRedirectUri,
|
|
144
|
-
authorizeBaseUrl,
|
|
145
118
|
sessionMode = 'account',
|
|
146
119
|
identity,
|
|
147
|
-
webAuthMode = 'redirect',
|
|
148
120
|
sessionClient,
|
|
149
121
|
syncDeviceCredentialToHost,
|
|
150
122
|
commitSession,
|
|
@@ -157,28 +129,19 @@ export async function runProviderColdBoot(opts: RunProviderColdBootOptions): Pro
|
|
|
157
129
|
setTokenReady(false);
|
|
158
130
|
|
|
159
131
|
try {
|
|
160
|
-
//
|
|
161
|
-
//
|
|
162
|
-
//
|
|
163
|
-
//
|
|
164
|
-
//
|
|
165
|
-
//
|
|
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.
|
|
132
|
+
// The redirect transport's RETURN leg. An app reaches it whenever the browser
|
|
133
|
+
// BLOCKED the sign-in popup and `startWebOAuthSignIn` fell back to a
|
|
134
|
+
// full-page redirect (`popup-blocked` / `popup-navigation-failed`), so it is
|
|
135
|
+
// load-bearing even though nothing here ever starts a redirect. It consumes a
|
|
136
|
+
// code (or a stale OAuth `error`) already in the address bar and rewrites the
|
|
137
|
+
// URL via `history.replaceState`; it never begins a navigation.
|
|
175
138
|
const oauthCompleted = identityBound
|
|
176
139
|
? false
|
|
177
140
|
: await tryCompleteOAuthReturn({
|
|
178
141
|
oxyServices,
|
|
179
142
|
clientId,
|
|
180
143
|
authRedirectUri,
|
|
181
|
-
commitSession: (input) => commitSession(input, { activate: true
|
|
144
|
+
commitSession: (input) => commitSession(input, { activate: true }),
|
|
182
145
|
});
|
|
183
146
|
if (oauthCompleted) {
|
|
184
147
|
setTokenReady(true);
|
|
@@ -192,7 +155,7 @@ export async function runProviderColdBoot(opts: RunProviderColdBootOptions): Pro
|
|
|
192
155
|
// resolves to "online" — the network steps still run.
|
|
193
156
|
const offline = await detectOfflineHint();
|
|
194
157
|
|
|
195
|
-
|
|
158
|
+
await runSessionColdBoot({
|
|
196
159
|
oxy: oxyServices,
|
|
197
160
|
store: authStore,
|
|
198
161
|
platform: { isWeb: isWebBrowser(), isNative: !isWebBrowser() },
|
|
@@ -259,46 +222,6 @@ export async function runProviderColdBoot(opts: RunProviderColdBootOptions): Pro
|
|
|
259
222
|
}
|
|
260
223
|
},
|
|
261
224
|
});
|
|
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
|
-
}
|
|
302
225
|
} catch (error) {
|
|
303
226
|
if (__DEV__) {
|
|
304
227
|
loggerUtil.error(
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import type { ViewStyle } from 'react-native';
|
|
3
|
+
import { View } from 'react-native-css/components';
|
|
3
4
|
import Ionicons from '@expo/vector-icons/Ionicons';
|
|
4
5
|
import { useTheme } from '@oxyhq/bloom/theme';
|
|
5
6
|
|
|
@@ -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/toast';
|
|
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,7 +75,19 @@ 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(() =>
|
|
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]);
|
|
79
91
|
// An ENTRY view (accounts / signin — no in-dialog back of its own) that is
|
|
80
92
|
// MORPHED into a host surface (ManageAccount → switcher) has a frame beneath it,
|
|
81
93
|
// 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/toast';
|
|
40
40
|
import { useTheme } from '@oxyhq/bloom/theme';
|
|
41
41
|
import type { AccountDialogSnapshot } from '@oxyhq/core';
|
|
42
42
|
import { isOxyRpOrigin } from '@oxyhq/core';
|
|
@@ -72,6 +72,13 @@ 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;
|
|
75
82
|
}
|
|
76
83
|
|
|
77
84
|
/**
|
|
@@ -79,7 +86,10 @@ export interface OxyAuthChooserProps {
|
|
|
79
86
|
* (wrapped in Bloom's `<Dialog>`) today; mountable bare by any future host that
|
|
80
87
|
* supplies its own `onComplete`.
|
|
81
88
|
*/
|
|
82
|
-
const OxyAuthChooser: React.FC<OxyAuthChooserProps> = ({
|
|
89
|
+
const OxyAuthChooser: React.FC<OxyAuthChooserProps> = ({
|
|
90
|
+
onComplete,
|
|
91
|
+
autoStartSignIn: autoStartSignInEnabled = true,
|
|
92
|
+
}) => {
|
|
83
93
|
const {
|
|
84
94
|
accountDialogController: controller,
|
|
85
95
|
showBottomSheet,
|
|
@@ -161,11 +171,11 @@ const OxyAuthChooser: React.FC<OxyAuthChooserProps> = ({ onComplete }) => {
|
|
|
161
171
|
// a no-op on native (button-driven). Reads the live snapshot at call time (an
|
|
162
172
|
// event callback, not render), so it is stable across renders.
|
|
163
173
|
const autoStartSignIn = useCallback(() => {
|
|
164
|
-
if (!controller || !isWebBrowser()) return;
|
|
174
|
+
if (!autoStartSignInEnabled || !controller || !isWebBrowser()) return;
|
|
165
175
|
const { view: currentView, signIn } = controller.getSnapshot();
|
|
166
176
|
if ((currentView !== 'signin' && currentView !== 'add') || signIn.phase !== 'idle') return;
|
|
167
177
|
void controller.signInWithOxy();
|
|
168
|
-
}, [controller]);
|
|
178
|
+
}, [autoStartSignInEnabled, controller]);
|
|
169
179
|
|
|
170
180
|
// Bind the headless controller. `getSnapshot` returns a stable reference
|
|
171
181
|
// between changes, so it is `useSyncExternalStore`-safe. Guard the no-provider
|
|
@@ -210,25 +220,19 @@ const OxyAuthChooser: React.FC<OxyAuthChooserProps> = ({ onComplete }) => {
|
|
|
210
220
|
const snapshot = useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
|
|
211
221
|
const { view } = snapshot;
|
|
212
222
|
|
|
213
|
-
const [switching, setSwitching] = useState(false);
|
|
214
|
-
|
|
215
223
|
const handleSwitch = useCallback(
|
|
216
224
|
async (accountId: string) => {
|
|
217
|
-
if (!controller
|
|
218
|
-
if (
|
|
225
|
+
if (!controller) return;
|
|
226
|
+
if (controller.getSnapshot().switchingAccountId) return;
|
|
227
|
+
if (accountId === controller.getSnapshot().activeAccountId) {
|
|
219
228
|
onComplete?.();
|
|
220
229
|
return;
|
|
221
230
|
}
|
|
222
|
-
setSwitching(true);
|
|
223
231
|
try {
|
|
224
232
|
await controller.switchTo(accountId);
|
|
225
|
-
// `switchTo`
|
|
226
|
-
//
|
|
227
|
-
//
|
|
228
|
-
// and NOT a snapshot-reaction). On success reload the app's account
|
|
229
|
-
// graph and drop cached account-scoped data so the new active identity
|
|
230
|
-
// re-fetches — the same side effects the context's own
|
|
231
|
-
// `switchToAccount` performs.
|
|
233
|
+
// `switchTo` records failures on the controller snapshot. Read that
|
|
234
|
+
// state after the operation so the same path works with both the real
|
|
235
|
+
// controller and framework test doubles that return void.
|
|
232
236
|
if (controller.getSnapshot().error) {
|
|
233
237
|
toast.error(t('accountSwitcher.toasts.switchFailed'));
|
|
234
238
|
return;
|
|
@@ -236,11 +240,11 @@ const OxyAuthChooser: React.FC<OxyAuthChooserProps> = ({ onComplete }) => {
|
|
|
236
240
|
void refreshAccounts();
|
|
237
241
|
queryClient.invalidateQueries();
|
|
238
242
|
onComplete?.();
|
|
239
|
-
}
|
|
240
|
-
|
|
243
|
+
} catch {
|
|
244
|
+
// `switchTo` is documented as non-throwing; guard against regressions.
|
|
241
245
|
}
|
|
242
246
|
},
|
|
243
|
-
[controller,
|
|
247
|
+
[controller, onComplete, refreshAccounts, queryClient, t],
|
|
244
248
|
);
|
|
245
249
|
|
|
246
250
|
const handleManage = useCallback(() => {
|
|
@@ -307,7 +311,7 @@ const OxyAuthChooser: React.FC<OxyAuthChooserProps> = ({ onComplete }) => {
|
|
|
307
311
|
// Real storage usage for the account menu's "Oxy storage" block. Disabled
|
|
308
312
|
// (no fetch) until a private-API session exists, so it is inert on the
|
|
309
313
|
// sign-in/request/sign-up views; when present the block shows live used/total.
|
|
310
|
-
const storageQuery = useAccountStorageUsage();
|
|
314
|
+
const storageQuery = useAccountStorageUsage({ enabled: view === 'accounts' });
|
|
311
315
|
const storage = useMemo<AccountStorageModel | null>(
|
|
312
316
|
() =>
|
|
313
317
|
storageQuery.data
|
|
@@ -344,6 +348,13 @@ const OxyAuthChooser: React.FC<OxyAuthChooserProps> = ({ onComplete }) => {
|
|
|
344
348
|
void logout();
|
|
345
349
|
onComplete?.();
|
|
346
350
|
},
|
|
351
|
+
customItems: (getAccountDialogConsumerHooks()?.menuItems ?? []).map((item) => ({
|
|
352
|
+
...item,
|
|
353
|
+
onPress: () => {
|
|
354
|
+
onComplete?.();
|
|
355
|
+
item.onPress();
|
|
356
|
+
},
|
|
357
|
+
})),
|
|
347
358
|
};
|
|
348
359
|
}, [onComplete, showBottomSheet, logout]);
|
|
349
360
|
|
|
@@ -5,13 +5,14 @@ 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/dialog';
|
|
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';
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
18
|
* Background color shown for the brief window between mount and the
|
|
@@ -92,10 +93,10 @@ const OxyProvider: FC<OxyProviderProps> = ({
|
|
|
92
93
|
authRedirectUri,
|
|
93
94
|
authorizeBaseUrl,
|
|
94
95
|
sessionMode = 'account',
|
|
95
|
-
webAuthMode = '
|
|
96
|
+
webAuthMode = 'popup',
|
|
96
97
|
queryClient: providedQueryClient,
|
|
97
98
|
requireAuth = 'off',
|
|
98
|
-
|
|
99
|
+
backgroundSession = false,
|
|
99
100
|
}) => {
|
|
100
101
|
|
|
101
102
|
// Dynamic KeyboardProvider for native. Uses variable indirection
|
|
@@ -230,10 +231,10 @@ const OxyProvider: FC<OxyProviderProps> = ({
|
|
|
230
231
|
try {
|
|
231
232
|
const NetInfo = await import('@react-native-community/netinfo');
|
|
232
233
|
const state = await NetInfo.default.fetch();
|
|
233
|
-
onlineManager.setOnline(state
|
|
234
|
+
onlineManager.setOnline(isNetConnectivityOnline(state));
|
|
234
235
|
|
|
235
|
-
const unsubscribe = NetInfo.default.addEventListener((state: { isConnected: boolean | null }) => {
|
|
236
|
-
onlineManager.setOnline(state
|
|
236
|
+
const unsubscribe = NetInfo.default.addEventListener((state: { isConnected: boolean | null; isInternetReachable?: boolean | null }) => {
|
|
237
|
+
onlineManager.setOnline(isNetConnectivityOnline(state));
|
|
237
238
|
});
|
|
238
239
|
|
|
239
240
|
cleanup = () => unsubscribe();
|
|
@@ -293,7 +294,7 @@ const OxyProvider: FC<OxyProviderProps> = ({
|
|
|
293
294
|
clientId={clientId}
|
|
294
295
|
sessionMode={sessionMode}
|
|
295
296
|
webAuthMode={webAuthMode}
|
|
296
|
-
|
|
297
|
+
backgroundSession={backgroundSession}
|
|
297
298
|
onAuthStateChange={onAuthStateChange as OxyContextProviderProps['onAuthStateChange']}
|
|
298
299
|
>
|
|
299
300
|
<SurfaceProvider>
|