@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
package/README.md
CHANGED
|
@@ -455,7 +455,7 @@ function LoginScreen() {
|
|
|
455
455
|
```
|
|
456
456
|
|
|
457
457
|
- **Official Oxy apps** (`isOfficial` / first-party types): opens the in-app account dialog.
|
|
458
|
-
- **Third-party apps** (`type: 'third_party'`): starts the standard OAuth 2.0 Authorization Code + PKCE flow against `auth.oxy.so` (the SDK generates `state` + PKCE via `@oxyhq/core`). On web the transport is `OxyProvider` prop `webAuthMode: 'popup' | 'redirect'` (default `'
|
|
458
|
+
- **Third-party apps** (`type: 'third_party'`): starts the standard OAuth 2.0 Authorization Code + PKCE flow against `auth.oxy.so` (the SDK generates `state` + PKCE via `@oxyhq/core`). On web the transport is `OxyProvider` prop `webAuthMode: 'popup' | 'redirect'` (default `'redirect'`; issue #691 Phase 2) — `'popup'` opens a small window and relays the result via `postMessage` without navigating your app's tab, falling back to a redirect if the browser blocks it. Pass `oauthRedirectUri`; on native handle `onOAuthResult` to complete the token exchange.
|
|
459
459
|
|
|
460
460
|
See the [integration guide](../../docs/auth/integration-guide.md) for Console registration, OAuth endpoints, and backend verification, and [AUTHENTICATION.md](../../docs/AUTHENTICATION.md) for the full model.
|
|
461
461
|
|
|
@@ -694,7 +694,7 @@ Typed returns are defined in `ui/hooks/queries/paymentTypes.ts` (`Subscription`,
|
|
|
694
694
|
|
|
695
695
|
## Sign-In Token Planting
|
|
696
696
|
|
|
697
|
-
`@oxyhq/core` `OxyServices.verifyChallenge()` plants `setTokens(accessToken)` internally before returning. `useAuthOperations.performSignIn` no longer needs to hand-plant the token or call a session-token fallback — just await `verifyChallenge` and proceed.
|
|
697
|
+
`@oxyhq/core` `OxyServices.verifyChallenge()` plants `setTokens(accessToken, refreshToken ?? '')` internally before returning. `useAuthOperations.performSignIn` no longer needs to hand-plant the token or call a session-token fallback — just await `verifyChallenge` and proceed.
|
|
698
698
|
|
|
699
699
|
## Requirements
|
|
700
700
|
|
|
@@ -2,8 +2,12 @@ package so.oxy.identity
|
|
|
2
2
|
|
|
3
3
|
import android.content.Context
|
|
4
4
|
import android.content.SharedPreferences
|
|
5
|
-
import
|
|
6
|
-
import
|
|
5
|
+
import android.util.Log
|
|
6
|
+
import androidx.security.crypto.EncryptedSharedPreferences
|
|
7
|
+
import androidx.security.crypto.MasterKey
|
|
8
|
+
import java.io.IOException
|
|
9
|
+
import java.security.GeneralSecurityException
|
|
10
|
+
import java.security.KeyStore
|
|
7
11
|
|
|
8
12
|
/**
|
|
9
13
|
* Shared accessor for the hardware-backed EncryptedSharedPreferences that holds
|
|
@@ -11,35 +15,137 @@ import so.oxy.storage.RecoveryPolicy
|
|
|
11
15
|
*
|
|
12
16
|
* Used by BOTH [OxyIdentityModule] (the JS bridge / local read + write) and
|
|
13
17
|
* [OxyIdentityProvider] (the cross-process read surface) so the store name and
|
|
14
|
-
* the encryption scheme can never drift between the two halves.
|
|
18
|
+
* the AES256 encryption scheme can never drift between the two halves.
|
|
15
19
|
*
|
|
16
|
-
*
|
|
17
|
-
* self-heal, both load-bearing and non-obvious — lives in [OxyEncryptedPrefs],
|
|
18
|
-
* which is shared with the background-session store. Read its documentation
|
|
19
|
-
* before changing anything about how this file is opened.
|
|
20
|
+
* ## Single memoized instance (CRITICAL)
|
|
20
21
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
22
|
+
* `EncryptedSharedPreferences.create()` must be called AT MOST ONCE per file per
|
|
23
|
+
* process. It is NOT safe to re-instantiate: when a second instance is created
|
|
24
|
+
* for the same file while another is live (e.g. the JS write thread and a Binder
|
|
25
|
+
* thread serving [OxyIdentityProvider.call] concurrently), Tink's keyset load
|
|
26
|
+
* races and the next decrypt throws `AEADBadTagException` — which silently turned
|
|
27
|
+
* every cross-app read into "no shared identity". So the instance is created once,
|
|
28
|
+
* lazily, under a lock, keyed on the process-global application context, and
|
|
29
|
+
* reused for all reads/writes/provider calls.
|
|
30
|
+
*
|
|
31
|
+
* ## Keyset self-heal (CRITICAL)
|
|
32
|
+
*
|
|
33
|
+
* The androidx master key that wraps this file's Tink keyset lives under the
|
|
34
|
+
* UID-scoped default alias [MasterKey.DEFAULT_MASTER_KEY_ALIAS] — one entry for
|
|
35
|
+
* the whole `so.oxy.shared` UID. When a NEW package joins that shared UID, that
|
|
36
|
+
* master key can be rotated/regenerated, leaving the keyset already written into
|
|
37
|
+
* `oxy_shared_identity.xml` wrapped under the OLD key. `create()` then fails GCM
|
|
38
|
+
* verification (`AEADBadTag` -> `GeneralSecurityException`, or an unreadable
|
|
39
|
+
* keyset -> `IOException`) on EVERY read/write, and `EncryptedSharedPreferences`
|
|
40
|
+
* never self-heals — the slot stays permanently dead and cross-app "Sign in with
|
|
41
|
+
* Oxy" silently falls back to interactive import.
|
|
42
|
+
*
|
|
43
|
+
* [openOrHealPrefs] recovers ONCE, in two bounded stages (no retry loop):
|
|
44
|
+
* 1. Delete ONLY this slot's prefs file (the stale wrapped keyset) and rebuild
|
|
45
|
+
* against the current master key — heals the common rotation case without
|
|
46
|
+
* touching the master key, so other shared-UID members keep their keysets.
|
|
47
|
+
* 2. If a fresh keyset STILL can't be built, the master key itself is unusable:
|
|
48
|
+
* delete its keystore alias so a new one is generated, wipe the file again,
|
|
49
|
+
* and rebuild. If that final rebuild throws, the exception propagates and the
|
|
50
|
+
* existing `runCatching {}` at every call site degrades to null.
|
|
51
|
+
*
|
|
52
|
+
* This NEVER touches the primary self-custody identity: that lives in
|
|
53
|
+
* expo-secure-store under a DISTINCT prefs file ("SecureStore") and DISTINCT
|
|
54
|
+
* keystore aliases ("key_v1"/extended), not the androidx master key wiped here.
|
|
55
|
+
* The shared slot is a derived copy that Commons re-populates from the primary on
|
|
56
|
+
* the next boot (`migrateToSharedIdentity`), so wiping it is non-destructive.
|
|
27
57
|
*/
|
|
28
58
|
internal object OxyIdentityStore {
|
|
29
59
|
const val PREFS_NAME = "oxy_shared_identity"
|
|
30
60
|
const val KEY_PRIVATE = "priv"
|
|
31
61
|
const val KEY_PUBLIC = "pub"
|
|
32
62
|
|
|
63
|
+
private const val TAG = "OxyIdentityStore"
|
|
64
|
+
private const val ANDROID_KEYSTORE = "AndroidKeyStore"
|
|
65
|
+
|
|
66
|
+
@Volatile private var cachedPrefs: SharedPreferences? = null
|
|
67
|
+
|
|
68
|
+
private fun prefs(context: Context): SharedPreferences {
|
|
69
|
+
cachedPrefs?.let { return it }
|
|
70
|
+
return synchronized(this) {
|
|
71
|
+
cachedPrefs ?: openOrHealPrefs(context.applicationContext).also { cachedPrefs = it }
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
33
75
|
/**
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* the collateral is not worse than the failure it recovers from — and because
|
|
39
|
-
* this slot is itself re-populated from the primary identity on the next boot.
|
|
76
|
+
* Opens the EncryptedSharedPreferences, self-healing a corrupted/unreadable
|
|
77
|
+
* keyset once (see the "Keyset self-heal" note above). Both exception types the
|
|
78
|
+
* androidx `create()` declares — `GeneralSecurityException` (AEAD/GCM tag
|
|
79
|
+
* mismatch) and `IOException` (unparseable keyset) — route into recovery.
|
|
40
80
|
*/
|
|
41
|
-
private fun
|
|
42
|
-
|
|
81
|
+
private fun openOrHealPrefs(appContext: Context): SharedPreferences {
|
|
82
|
+
return try {
|
|
83
|
+
buildEncryptedPrefs(appContext)
|
|
84
|
+
} catch (corrupt: GeneralSecurityException) {
|
|
85
|
+
healCorruptedKeyset(appContext, corrupt)
|
|
86
|
+
} catch (corrupt: IOException) {
|
|
87
|
+
healCorruptedKeyset(appContext, corrupt)
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Stage 1: wipe ONLY this slot's prefs file (which holds the stale wrapped
|
|
93
|
+
* keyset) and rebuild against the current master key. Escalates to stage 2 if a
|
|
94
|
+
* fresh keyset still can't be built.
|
|
95
|
+
*/
|
|
96
|
+
private fun healCorruptedKeyset(appContext: Context, cause: Exception): SharedPreferences {
|
|
97
|
+
Log.w(
|
|
98
|
+
TAG,
|
|
99
|
+
"shared-identity keyset unreadable (rotated master key); cleared and regenerated: ${cause.message}",
|
|
100
|
+
cause
|
|
101
|
+
)
|
|
102
|
+
appContext.deleteSharedPreferences(PREFS_NAME)
|
|
103
|
+
return try {
|
|
104
|
+
buildEncryptedPrefs(appContext)
|
|
105
|
+
} catch (stillCorrupt: GeneralSecurityException) {
|
|
106
|
+
regenerateMasterKeyAndRebuild(appContext, stillCorrupt)
|
|
107
|
+
} catch (stillCorrupt: IOException) {
|
|
108
|
+
regenerateMasterKeyAndRebuild(appContext, stillCorrupt)
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Stage 2 (belt-and-suspenders): the androidx master key itself is unusable, so
|
|
114
|
+
* delete its keystore alias to force a fresh one, wipe the now-stale file again,
|
|
115
|
+
* and rebuild. The alias is used ONLY by androidx EncryptedSharedPreferences —
|
|
116
|
+
* expo-secure-store (the primary identity) uses its own distinct aliases — so
|
|
117
|
+
* this never touches the self-custody key. A throw here propagates to the
|
|
118
|
+
* call-site `runCatching {}`, which degrades to null.
|
|
119
|
+
*/
|
|
120
|
+
private fun regenerateMasterKeyAndRebuild(appContext: Context, cause: Exception): SharedPreferences {
|
|
121
|
+
Log.w(
|
|
122
|
+
TAG,
|
|
123
|
+
"shared-identity keyset still unreadable after prefs reset; deleting master key " +
|
|
124
|
+
"'${MasterKey.DEFAULT_MASTER_KEY_ALIAS}' and regenerating: ${cause.message}",
|
|
125
|
+
cause
|
|
126
|
+
)
|
|
127
|
+
KeyStore.getInstance(ANDROID_KEYSTORE).apply {
|
|
128
|
+
load(null)
|
|
129
|
+
if (containsAlias(MasterKey.DEFAULT_MASTER_KEY_ALIAS)) {
|
|
130
|
+
deleteEntry(MasterKey.DEFAULT_MASTER_KEY_ALIAS)
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
appContext.deleteSharedPreferences(PREFS_NAME)
|
|
134
|
+
return buildEncryptedPrefs(appContext)
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
private fun buildEncryptedPrefs(appContext: Context): SharedPreferences {
|
|
138
|
+
val masterKey = MasterKey.Builder(appContext)
|
|
139
|
+
.setKeyScheme(MasterKey.KeyScheme.AES256_GCM)
|
|
140
|
+
.build()
|
|
141
|
+
return EncryptedSharedPreferences.create(
|
|
142
|
+
appContext,
|
|
143
|
+
PREFS_NAME,
|
|
144
|
+
masterKey,
|
|
145
|
+
EncryptedSharedPreferences.PrefKeyEncryptionScheme.AES256_SIV,
|
|
146
|
+
EncryptedSharedPreferences.PrefValueEncryptionScheme.AES256_GCM
|
|
147
|
+
)
|
|
148
|
+
}
|
|
43
149
|
|
|
44
150
|
/** Read the stored keypair as (privateKey, publicKey), or null when absent/blank. */
|
|
45
151
|
fun read(context: Context): Pair<String, String>? {
|
package/expo-module.config.json
CHANGED
package/lib/commonjs/index.js
CHANGED
|
@@ -183,12 +183,30 @@ Object.defineProperty(exports, "extractErrorMessage", {
|
|
|
183
183
|
return _errorHandlers.extractErrorMessage;
|
|
184
184
|
}
|
|
185
185
|
});
|
|
186
|
+
Object.defineProperty(exports, "getExpoPushToken", {
|
|
187
|
+
enumerable: true,
|
|
188
|
+
get: function () {
|
|
189
|
+
return _deviceNotifications.getExpoPushToken;
|
|
190
|
+
}
|
|
191
|
+
});
|
|
186
192
|
Object.defineProperty(exports, "handleAuthError", {
|
|
187
193
|
enumerable: true,
|
|
188
194
|
get: function () {
|
|
189
195
|
return _errorHandlers.handleAuthError;
|
|
190
196
|
}
|
|
191
197
|
});
|
|
198
|
+
Object.defineProperty(exports, "hasNotificationPermission", {
|
|
199
|
+
enumerable: true,
|
|
200
|
+
get: function () {
|
|
201
|
+
return _deviceNotifications.hasNotificationPermission;
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
Object.defineProperty(exports, "installForegroundNotificationHandler", {
|
|
205
|
+
enumerable: true,
|
|
206
|
+
get: function () {
|
|
207
|
+
return _deviceNotifications.installForegroundNotificationHandler;
|
|
208
|
+
}
|
|
209
|
+
});
|
|
192
210
|
Object.defineProperty(exports, "invalidateAccountQueries", {
|
|
193
211
|
enumerable: true,
|
|
194
212
|
get: function () {
|
|
@@ -279,12 +297,24 @@ Object.defineProperty(exports, "openOAuthPopup", {
|
|
|
279
297
|
return _oauthPopup.openOAuthPopup;
|
|
280
298
|
}
|
|
281
299
|
});
|
|
300
|
+
Object.defineProperty(exports, "pushTokenPlatform", {
|
|
301
|
+
enumerable: true,
|
|
302
|
+
get: function () {
|
|
303
|
+
return _deviceNotifications.pushTokenPlatform;
|
|
304
|
+
}
|
|
305
|
+
});
|
|
282
306
|
Object.defineProperty(exports, "queryKeys", {
|
|
283
307
|
enumerable: true,
|
|
284
308
|
get: function () {
|
|
285
309
|
return _queryKeys.queryKeys;
|
|
286
310
|
}
|
|
287
311
|
});
|
|
312
|
+
Object.defineProperty(exports, "requestNotificationPermission", {
|
|
313
|
+
enumerable: true,
|
|
314
|
+
get: function () {
|
|
315
|
+
return _deviceNotifications.requestNotificationPermission;
|
|
316
|
+
}
|
|
317
|
+
});
|
|
288
318
|
Object.defineProperty(exports, "setOxyAssetInstance", {
|
|
289
319
|
enumerable: true,
|
|
290
320
|
get: function () {
|
|
@@ -303,6 +333,18 @@ Object.defineProperty(exports, "subscribeToAccountDialog", {
|
|
|
303
333
|
return _accountDialogManager.subscribeToAccountDialog;
|
|
304
334
|
}
|
|
305
335
|
});
|
|
336
|
+
Object.defineProperty(exports, "subscribeToNotificationResponses", {
|
|
337
|
+
enumerable: true,
|
|
338
|
+
get: function () {
|
|
339
|
+
return _deviceNotifications.subscribeToNotificationResponses;
|
|
340
|
+
}
|
|
341
|
+
});
|
|
342
|
+
Object.defineProperty(exports, "takeLaunchNotificationData", {
|
|
343
|
+
enumerable: true,
|
|
344
|
+
get: function () {
|
|
345
|
+
return _deviceNotifications.takeLaunchNotificationData;
|
|
346
|
+
}
|
|
347
|
+
});
|
|
306
348
|
Object.defineProperty(exports, "upsertCachedUser", {
|
|
307
349
|
enumerable: true,
|
|
308
350
|
get: function () {
|
|
@@ -710,6 +752,7 @@ var _useOnlineStatus = require("./ui/hooks/useOnlineStatus.js");
|
|
|
710
752
|
var _useOxyEvent = require("./ui/hooks/useOxyEvent.js");
|
|
711
753
|
var _errorHandlers = require("./ui/utils/errorHandlers.js");
|
|
712
754
|
var _useFileFiltering = require("./ui/hooks/useFileFiltering.js");
|
|
755
|
+
var _deviceNotifications = require("./notifications/deviceNotifications.js");
|
|
713
756
|
var _OxySignInButton = _interopRequireDefault(require("./ui/components/OxySignInButton.js"));
|
|
714
757
|
var _oauthPopup = require("./ui/oauth/oauthPopup.js");
|
|
715
758
|
var _OxyAuthPrompt = require("./ui/components/OxyAuthPrompt.js");
|
|
@@ -817,25 +860,13 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
817
860
|
// ---------------------------------------------------------------------------
|
|
818
861
|
|
|
819
862
|
// ---------------------------------------------------------------------------
|
|
820
|
-
// Device notifications
|
|
863
|
+
// Device notifications (the ONE `expo-notifications` adapter)
|
|
821
864
|
// ---------------------------------------------------------------------------
|
|
822
|
-
// The
|
|
823
|
-
//
|
|
824
|
-
//
|
|
825
|
-
//
|
|
826
|
-
//
|
|
827
|
-
// and `expo-constants`) are optional peers that an app which does not use push
|
|
828
|
-
// genuinely never installs. Re-exporting it from THIS barrel is what made that
|
|
829
|
-
// optionality a lie: a barrel export puts the module in the import graph of
|
|
830
|
-
// every consumer, and `tsc` must resolve the specifier of an `import()` even
|
|
831
|
-
// when the call is lazy and wrapped in try/catch — so every consumer without
|
|
832
|
-
// `expo-notifications` failed with TS2307 (plus TS7006 cascades) whether or not
|
|
833
|
-
// it had ever heard of push. Behind a subpath the module is only ever pulled in
|
|
834
|
-
// by an app that asked for it, which is what "optional peer" is supposed to
|
|
835
|
-
// mean.
|
|
836
|
-
//
|
|
837
|
-
// Do NOT re-add these exports here. `__tests__/notifications/barrelIsolation.test.ts`
|
|
838
|
-
// fails if you do.
|
|
865
|
+
// The Expo-side half of push: permission, platform tag, and the EXPO push token
|
|
866
|
+
// `@oxyhq/core`'s `registerPushToken` accepts (never a raw APNs/FCM token).
|
|
867
|
+
// Native-only by construction — every entry point resolves its null/no-op result
|
|
868
|
+
// from `Platform.OS` before `expo-notifications` is ever imported, and both
|
|
869
|
+
// `expo-notifications` and `expo-constants` are OPTIONAL peers.
|
|
839
870
|
|
|
840
871
|
// ---------------------------------------------------------------------------
|
|
841
872
|
// UI components
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_core","require","_reactNative","_OxyProvider","_interopRequireDefault","_OxyContext","_useAuth","_identityBinding","_authStore","_accountStore","_assetStore","_useAssets","_useFileDownloadUrl","_useFollow","_useStorage","_useAccountQueries","_useServicesQueries","_useSecurityQueries","_useAuthMethods","_usePaymentQueries","_useAccountMutations","_useServicesMutations","_mutationFactory","_mutationKeys","_queryKeys","_userCache","_useMutationStatus","_useOnlineStatus","_useOxyEvent","_errorHandlers","_useFileFiltering","_OxySignInButton","_oauthPopup","_OxyAuthPrompt","_OxyOAuthCallback","_OxyConsentScreen","_RequireOxyAuth","_FollowButton","_OxyPayButton","_LogoIcon","_LogoText","_ProfileButton","_OxyAuthChooser","_OxySignInRequestSurface","_useSwitchableAccounts","_ProfileScreen","_ManageAccountScreen","_NotificationsScreen","_PreferencesScreen","_ConnectedAppsScreen","_CreateAccountScreen","_AccountMembersScreen","_AccountSettingsScreen","_bottomSheetManager","_useSurfaceHeader","_SurfaceHeaderAction","_accountDialogManager","e","__esModule","default","setPlatformOS","Platform","OS"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_core","require","_reactNative","_OxyProvider","_interopRequireDefault","_OxyContext","_useAuth","_identityBinding","_authStore","_accountStore","_assetStore","_useAssets","_useFileDownloadUrl","_useFollow","_useStorage","_useAccountQueries","_useServicesQueries","_useSecurityQueries","_useAuthMethods","_usePaymentQueries","_useAccountMutations","_useServicesMutations","_mutationFactory","_mutationKeys","_queryKeys","_userCache","_useMutationStatus","_useOnlineStatus","_useOxyEvent","_errorHandlers","_useFileFiltering","_deviceNotifications","_OxySignInButton","_oauthPopup","_OxyAuthPrompt","_OxyOAuthCallback","_OxyConsentScreen","_RequireOxyAuth","_FollowButton","_OxyPayButton","_LogoIcon","_LogoText","_ProfileButton","_OxyAuthChooser","_OxySignInRequestSurface","_useSwitchableAccounts","_ProfileScreen","_ManageAccountScreen","_NotificationsScreen","_PreferencesScreen","_ConnectedAppsScreen","_CreateAccountScreen","_AccountMembersScreen","_AccountSettingsScreen","_bottomSheetManager","_useSurfaceHeader","_SurfaceHeaderAction","_accountDialogManager","e","__esModule","default","setPlatformOS","Platform","OS"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;AACA,IAAAoD,sBAAA,GAAAjD,sBAAA,CAAAH,OAAA;AAKA,IAAAqD,mBAAA,GAAArD,OAAA;AAMA,IAAAsD,iBAAA,GAAAtD,OAAA;AACA,IAAAuD,oBAAA,GAAAvD,OAAA;AAMA,IAAAwD,qBAAA,GAAAxD,OAAA;AAI8C,SAAAG,uBAAAsD,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAjV9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAIA,IAAAG,mBAAa,EAACC,qBAAQ,CAACC,EAAgB,CAAC;;AAExC;AACA;AACA;;AAMA;AACA;AACA;;AAGA;AACA;AACA;;AAgBA;AACA;AACA;;AAOA;AACA;AACA;;AAgCA;;AAeA;AACA;AACA;;AA2BA;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAeA;AACA;AACA;AACA;AACA;;AAIA;;AAMA;AACA;AACA;;AASA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAYA;AACA;AACA;;AAQA;AACA;AACA;AACA;;AAsBA;AACA;AACA;AACA;AACA;;AAUA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;;AAIA;;AAOA;;AAKA;AACA;AACA;;AAIA;AACA;AACA;;AAIA;AACA;AACA;AACA","ignoreList":[]}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.ensureNotificationChannel = ensureNotificationChannel;
|
|
7
6
|
exports.getExpoPushToken = getExpoPushToken;
|
|
8
7
|
exports.hasNotificationPermission = hasNotificationPermission;
|
|
9
8
|
exports.installForegroundNotificationHandler = installForegroundNotificationHandler;
|
|
@@ -23,25 +22,6 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
23
22
|
* already lives in `@oxyhq/core`; core may never import an `expo-*` module, and
|
|
24
23
|
* this adapter is the Expo-side half that closes that gap.
|
|
25
24
|
*
|
|
26
|
-
* ## Reached through its OWN entry point, never the root barrel
|
|
27
|
-
*
|
|
28
|
-
* ```ts
|
|
29
|
-
* import { getExpoPushToken } from '@oxyhq/services/notifications';
|
|
30
|
-
* ```
|
|
31
|
-
*
|
|
32
|
-
* This is the only module in the package that depends on peers an app which
|
|
33
|
-
* does not use push genuinely never installs, and a barrel export would put it
|
|
34
|
-
* in EVERY consumer's import graph. `tsc` resolves the specifier of an
|
|
35
|
-
* `import()` even when the call is lazy and inside a try/catch, so a barrel
|
|
36
|
-
* export turned "optional peer" into a hard requirement: consumers with no
|
|
37
|
-
* interest in push failed to type-check with TS2307. The subpath is what keeps
|
|
38
|
-
* the optionality honest — see the note in `src/index.ts`.
|
|
39
|
-
*
|
|
40
|
-
* Metro is the resolver that behaves differently here, and in the useful
|
|
41
|
-
* direction: an unresolvable DYNAMIC `import()` bundles fine (the `catch` below
|
|
42
|
-
* takes over at runtime), where a static import fails the build outright. That
|
|
43
|
-
* is why the runtime shape below must stay dynamic-and-guarded.
|
|
44
|
-
*
|
|
45
25
|
* ## Native-only by construction
|
|
46
26
|
*
|
|
47
27
|
* Every entry point resolves its null/no-op result from `Platform.OS` BEFORE the
|
|
@@ -310,49 +290,6 @@ async function takeLaunchNotificationData() {
|
|
|
310
290
|
*/
|
|
311
291
|
let foregroundHandlerAttempted = false;
|
|
312
292
|
|
|
313
|
-
/** How prominently Android surfaces a channel's notifications. */
|
|
314
|
-
|
|
315
|
-
/** An Android notification channel this app delivers on. */
|
|
316
|
-
|
|
317
|
-
/**
|
|
318
|
-
* Create (or update) an Android notification channel.
|
|
319
|
-
*
|
|
320
|
-
* A no-op everywhere but Android: iOS has no channels, and web never loads the
|
|
321
|
-
* native module. Call it BEFORE registering a push token, so the very first
|
|
322
|
-
* notification the server sends already has a channel to land on.
|
|
323
|
-
*
|
|
324
|
-
* Failure is non-fatal and logged: a missing channel costs visibility, and
|
|
325
|
-
* refusing to register a token over it would cost the feature entirely.
|
|
326
|
-
*
|
|
327
|
-
* @returns Whether the channel was actually created (`false` off Android, or
|
|
328
|
-
* when the native module is unavailable, or when creation failed).
|
|
329
|
-
*/
|
|
330
|
-
async function ensureNotificationChannel(spec) {
|
|
331
|
-
if (_reactNative.Platform.OS !== 'android') {
|
|
332
|
-
return false;
|
|
333
|
-
}
|
|
334
|
-
const notifications = await loadNotifications();
|
|
335
|
-
if (!notifications) {
|
|
336
|
-
return false;
|
|
337
|
-
}
|
|
338
|
-
try {
|
|
339
|
-
await notifications.setNotificationChannelAsync(spec.id, {
|
|
340
|
-
name: spec.name,
|
|
341
|
-
importance: spec.importance === 'high' ? notifications.AndroidImportance.HIGH : notifications.AndroidImportance.DEFAULT,
|
|
342
|
-
...(spec.description ? {
|
|
343
|
-
description: spec.description
|
|
344
|
-
} : {})
|
|
345
|
-
});
|
|
346
|
-
return true;
|
|
347
|
-
} catch (error) {
|
|
348
|
-
log.warn('could not create the notification channel', {
|
|
349
|
-
method: 'ensureNotificationChannel',
|
|
350
|
-
channelId: spec.id
|
|
351
|
-
}, error);
|
|
352
|
-
return false;
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
|
|
356
293
|
/**
|
|
357
294
|
* Install the ONE process-wide handler that decides whether an incoming
|
|
358
295
|
* notification is shown while the app is in the FOREGROUND.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_core","require","_reactNative","_interopRequireWildcard","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","log","createLogger","isRecord","value","loadNotifications","Platform","OS","Promise","resolve","then","error","warn","method","easProjectId","constants","debug","fromEasConfig","easConfig","projectId","length","extra","expoConfig","eas","undefined","pushTokenPlatform","hasNotificationPermission","notifications","permissions","getPermissionsAsync","granted","requestNotificationPermission","existing","canAskAgain","requested","requestPermissionsAsync","getExpoPushToken","token","getExpoPushTokenAsync","data","takeLaunchNotificationData","response","getLastNotificationResponse","notification","request","content","clearLastNotificationResponse","clearError","foregroundHandlerAttempted","
|
|
1
|
+
{"version":3,"names":["_core","require","_reactNative","_interopRequireWildcard","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","log","createLogger","isRecord","value","loadNotifications","Platform","OS","Promise","resolve","then","error","warn","method","easProjectId","constants","debug","fromEasConfig","easConfig","projectId","length","extra","expoConfig","eas","undefined","pushTokenPlatform","hasNotificationPermission","notifications","permissions","getPermissionsAsync","granted","requestNotificationPermission","existing","canAskAgain","requested","requestPermissionsAsync","getExpoPushToken","token","getExpoPushTokenAsync","data","takeLaunchNotificationData","response","getLastNotificationResponse","notification","request","content","clearLastNotificationResponse","clearError","foregroundHandlerAttempted","installForegroundNotificationHandler","decide","setNotificationHandler","handleNotification","show","shouldShowBanner","shouldShowList","shouldPlaySound","shouldSetBadge","subscribeToNotificationResponses","listener","subscription","addNotificationResponseReceivedListener","remove"],"sourceRoot":"../../../src","sources":["notifications/deviceNotifications.ts"],"mappings":";;;;;;;;;;;;AAsCA,IAAAA,KAAA,GAAAC,OAAA;AAEA,IAAAC,YAAA,GAAAD,OAAA;AAAwC,SAAAE,wBAAAC,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAH,uBAAA,YAAAA,CAAAC,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iB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F,IAAI;UACpB;UACA;UACAG,eAAe,EAAE,KAAK;UACtB;UACAC,cAAc,EAAE;QAClB,CAAC;MACH;IACF,CAAC,CAAC;IACF,OAAO,IAAI;EACb,CAAC,CAAC,OAAO9C,KAAK,EAAE;IACdV,GAAG,CAACW,IAAI,CACN,uDAAuD,EACvD;MAAEC,MAAM,EAAE;IAAuC,CAAC,EAClDF,KACF,CAAC;IACD,OAAO,KAAK;EACd;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,eAAe+C,gCAAgCA,CACpDC,QAAiC,EACZ;EACrB,MAAMhC,aAAa,GAAG,MAAMtB,iBAAiB,CAAC,CAAC;EAC/C,IAAI,CAACsB,aAAa,EAAE;IAClB,OAAO,MAAMH,SAAS;EACxB;EACA,IAAI;IACF,MAAMoC,YAAY,GAAGjC,aAAa,CAACkC,uCAAuC,CAAEpB,QAAQ,IAAK;MACvFkB,QAAQ,CAAClB,QAAQ,CAACE,YAAY,CAACC,OAAO,CAACC,OAAO,CAACN,IAAI,CAAC;IACtD,CAAC,CAAC;IACF,OAAO,MAAMqB,YAAY,CAACE,MAAM,CAAC,CAAC;EACpC,CAAC,CAAC,OAAOnD,KAAK,EAAE;IACdV,GAAG,CAACW,IAAI,CACN,0CAA0C,EAC1C;MAAEC,MAAM,EAAE;IAAmC,CAAC,EAC9CF,KACF,CAAC;IACD,OAAO,MAAMa,SAAS;EACxB;AACF","ignoreList":[]}
|
|
@@ -7,9 +7,10 @@ exports.SESSION_HANDOFF_DEADLINE_MS = exports.COLD_BOOT_OVERALL_DEADLINE_MS = vo
|
|
|
7
7
|
exports.runProviderColdBoot = runProviderColdBoot;
|
|
8
8
|
var _core = require("@oxyhq/core");
|
|
9
9
|
var _deviceCredential = require("../utils/deviceCredential.js");
|
|
10
|
+
var _crossOriginRestore = require("../utils/crossOriginRestore.js");
|
|
10
11
|
var _oauthReturn = require("../utils/oauthReturn.js");
|
|
11
12
|
var _isWebBrowser = require("../utils/isWebBrowser.js");
|
|
12
|
-
var
|
|
13
|
+
var _legacyRedirectLanes = require("../oauth/legacyRedirectLanes.js");
|
|
13
14
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
14
15
|
/** How long the cold boot waits for the post-boot SessionClient handoff (ms). */
|
|
15
16
|
const SESSION_HANDOFF_DEADLINE_MS = exports.SESSION_HANDOFF_DEADLINE_MS = 6000;
|
|
@@ -56,8 +57,8 @@ async function detectOfflineHint() {
|
|
|
56
57
|
setTimeout(() => resolve(null), OFFLINE_PROBE_TIMEOUT_MS);
|
|
57
58
|
})]);
|
|
58
59
|
// `null` ⇒ the probe timed out (unknown → assume online). Only an explicit
|
|
59
|
-
//
|
|
60
|
-
return
|
|
60
|
+
// `isConnected === false` disables the network steps.
|
|
61
|
+
return state?.isConnected === false;
|
|
61
62
|
} catch {
|
|
62
63
|
// NetInfo missing / probe threw — never block sign-in on a probe failure.
|
|
63
64
|
return false;
|
|
@@ -67,19 +68,19 @@ async function detectOfflineHint() {
|
|
|
67
68
|
* Device-first cold boot for `@oxyhq/services` providers.
|
|
68
69
|
*
|
|
69
70
|
* Ordered pipeline:
|
|
70
|
-
* 1. Complete
|
|
71
|
+
* 1. Complete OAuth authorization-code return (web)
|
|
71
72
|
* 2. `runSessionColdBoot` — device-secret mint (+ native shared-key, or the
|
|
72
73
|
* primary-identity-key lane in `sessionMode: 'identity'`)
|
|
74
|
+
* 3. Silent OAuth for all web apps when mint finds no session
|
|
73
75
|
*
|
|
74
|
-
*
|
|
75
|
-
* which for an identity-bound client is somebody else's account by
|
|
76
|
-
* In `'identity'` mode the boot is exactly step 2.
|
|
76
|
+
* Steps 1 and 3 are ACCOUNT-MODE ONLY: both commit whichever account the IdP
|
|
77
|
+
* resolves, which for an identity-bound client is somebody else's account by
|
|
78
|
+
* construction. In `'identity'` mode the boot is exactly step 2.
|
|
77
79
|
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
* navigation — it only consumes a code that is already in the address bar.
|
|
80
|
+
* Step 3 is additionally REDIRECT-MODE ONLY: it navigates the top-level window
|
|
81
|
+
* with no user gesture behind it, which `webAuthMode: 'popup'` exists to
|
|
82
|
+
* eliminate. In popup mode the boot is steps 1 and 2, and a domain with no local
|
|
83
|
+
* credential simply resolves signed out. See `allowsAutomaticIdpRedirect`.
|
|
83
84
|
*/
|
|
84
85
|
async function runProviderColdBoot(opts) {
|
|
85
86
|
const {
|
|
@@ -87,8 +88,10 @@ async function runProviderColdBoot(opts) {
|
|
|
87
88
|
authStore,
|
|
88
89
|
clientId,
|
|
89
90
|
authRedirectUri,
|
|
91
|
+
authorizeBaseUrl,
|
|
90
92
|
sessionMode = 'account',
|
|
91
93
|
identity,
|
|
94
|
+
webAuthMode = 'redirect',
|
|
92
95
|
sessionClient,
|
|
93
96
|
syncDeviceCredentialToHost,
|
|
94
97
|
commitSession,
|
|
@@ -98,18 +101,28 @@ async function runProviderColdBoot(opts) {
|
|
|
98
101
|
const identityBound = sessionMode === 'identity';
|
|
99
102
|
setTokenReady(false);
|
|
100
103
|
try {
|
|
101
|
-
//
|
|
102
|
-
//
|
|
103
|
-
//
|
|
104
|
-
//
|
|
105
|
-
//
|
|
106
|
-
// URL via `history.replaceState
|
|
104
|
+
// MODE-INDEPENDENT URL cleanup, deliberately so: both consume query params a
|
|
105
|
+
// PREVIOUS redirect-mode session left in the address bar (`?error=login_required`
|
|
106
|
+
// from a silent authorize, `?hub_sync=failed` from the hub) and restore the
|
|
107
|
+
// page the visit started on. Flipping an app to popup mode must not strand
|
|
108
|
+
// those params, so neither is gated on `webAuthMode`. Neither starts a
|
|
109
|
+
// navigation — they only rewrite the URL via `history.replaceState`.
|
|
110
|
+
(0, _crossOriginRestore.consumeSilentOAuthError)();
|
|
111
|
+
(0, _oauthReturn.consumeHubSyncFailure)();
|
|
112
|
+
|
|
113
|
+
// The redirect transport's RETURN leg — also NOT gated on `webAuthMode`. A
|
|
114
|
+
// popup-mode app legitimately lands here with `?code=` whenever the browser
|
|
115
|
+
// blocked the popup and `startWebOAuthSignIn` fell back to a full-page
|
|
116
|
+
// redirect (`popup-blocked` / `popup-navigation-failed`), and an app that
|
|
117
|
+
// switched modes mid-flight must not be stranded with a dead `?code=`
|
|
118
|
+
// either. It consumes a code already on the URL; it never starts one.
|
|
107
119
|
const oauthCompleted = identityBound ? false : await (0, _oauthReturn.tryCompleteOAuthReturn)({
|
|
108
120
|
oxyServices,
|
|
109
121
|
clientId,
|
|
110
122
|
authRedirectUri,
|
|
111
123
|
commitSession: input => commitSession(input, {
|
|
112
|
-
activate: true
|
|
124
|
+
activate: true,
|
|
125
|
+
hubSync: false
|
|
113
126
|
})
|
|
114
127
|
});
|
|
115
128
|
if (oauthCompleted) {
|
|
@@ -123,7 +136,7 @@ async function runProviderColdBoot(opts) {
|
|
|
123
136
|
// burning the overall deadline on a mint that cannot succeed. Any ambiguity
|
|
124
137
|
// resolves to "online" — the network steps still run.
|
|
125
138
|
const offline = await detectOfflineHint();
|
|
126
|
-
await (0, _core.runSessionColdBoot)({
|
|
139
|
+
const outcome = await (0, _core.runSessionColdBoot)({
|
|
127
140
|
oxy: oxyServices,
|
|
128
141
|
store: authStore,
|
|
129
142
|
platform: {
|
|
@@ -185,6 +198,37 @@ async function runProviderColdBoot(opts) {
|
|
|
185
198
|
}
|
|
186
199
|
}
|
|
187
200
|
});
|
|
201
|
+
|
|
202
|
+
// Silent cross-origin OAuth restore (web cross-app SSO): a full-page
|
|
203
|
+
// `prompt=none` bounce to the IdP when the mint found no local session.
|
|
204
|
+
//
|
|
205
|
+
// TRANSPORT gate (`allowsAutomaticIdpRedirect`): `webAuthMode: 'popup'`
|
|
206
|
+
// FORBIDS this lane. It navigates the top-level window with no user gesture
|
|
207
|
+
// behind it, which is precisely what popup mode exists to eliminate — a
|
|
208
|
+
// popup-mode domain without a local credential resolves signed out right
|
|
209
|
+
// here and waits for the user's next explicit "Continue with Oxy" (issue
|
|
210
|
+
// #691, "Cold boot and cross-domain behavior"). `'redirect'` — still the
|
|
211
|
+
// default and the compatibility path — reaches this lane unchanged, and this
|
|
212
|
+
// whole block disappears with the transport in phase 7b.
|
|
213
|
+
//
|
|
214
|
+
// ORIGIN gate: same as the hub-sync WRITE side (`syncHubAfterSignIn`) —
|
|
215
|
+
// official web origins only, never the IdP hub itself, and — unlike the
|
|
216
|
+
// write side — never a loopback / local-dev origin (which must not be
|
|
217
|
+
// bounced to a hosted IdP on cold boot). The authorize endpoint is
|
|
218
|
+
// env-configurable so a local/staging app targets its own IdP instead of
|
|
219
|
+
// production.
|
|
220
|
+
const webOrigin = (0, _isWebBrowser.isWebBrowser)() ? globalThis.location?.origin : undefined;
|
|
221
|
+
if (!identityBound && (0, _legacyRedirectLanes.allowsAutomaticIdpRedirect)(webAuthMode) && clientId && outcome.kind !== 'session' && webOrigin && (0, _crossOriginRestore.isSilentRestoreEligibleOrigin)(webOrigin)) {
|
|
222
|
+
const redirected = await (0, _crossOriginRestore.maybeStartSilentOAuthRestore)({
|
|
223
|
+
oxyServices,
|
|
224
|
+
clientId,
|
|
225
|
+
redirectUri: authRedirectUri,
|
|
226
|
+
authorizeBaseUrl
|
|
227
|
+
});
|
|
228
|
+
if (redirected) {
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
188
232
|
} catch (error) {
|
|
189
233
|
if (__DEV__) {
|
|
190
234
|
_core.logger.error('Cold boot error', error instanceof Error ? error : new Error(String(error)), {
|