@oxyhq/services 13.0.2 → 13.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/index.js +18 -11
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/ui/components/AccountMenuButton.js +8 -10
- package/lib/commonjs/ui/components/AccountMenuButton.js.map +1 -1
- package/lib/commonjs/ui/components/AccountSwitcher.js +65 -35
- package/lib/commonjs/ui/components/AccountSwitcher.js.map +1 -1
- package/lib/commonjs/ui/components/ProfileButton.js +233 -0
- package/lib/commonjs/ui/components/ProfileButton.js.map +1 -0
- package/lib/commonjs/ui/components/ProfileMenu.js +374 -0
- package/lib/commonjs/ui/components/ProfileMenu.js.map +1 -0
- package/lib/commonjs/ui/context/OxyContext.js +213 -101
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js +28 -1
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js.map +1 -1
- package/lib/commonjs/ui/hooks/queries/useAccountQueries.js +2 -2
- package/lib/commonjs/ui/hooks/queries/useAccountQueries.js.map +1 -1
- package/lib/commonjs/ui/hooks/queries/usePaymentQueries.js +12 -12
- package/lib/commonjs/ui/hooks/queries/usePaymentQueries.js.map +1 -1
- package/lib/commonjs/ui/hooks/queries/useServicesQueries.js +8 -7
- package/lib/commonjs/ui/hooks/queries/useServicesQueries.js.map +1 -1
- package/lib/commonjs/ui/index.js +14 -0
- package/lib/commonjs/ui/index.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js +11 -6
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +3 -3
- package/lib/commonjs/ui/screens/CreateAccountScreen.js +6 -4
- package/lib/commonjs/ui/screens/CreateAccountScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js +8 -7
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FileManagementScreen.js +13 -13
- package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HistoryViewScreen.js +7 -7
- package/lib/commonjs/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js +5 -5
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ManageAccountScreen.js +17 -18
- package/lib/commonjs/ui/screens/ManageAccountScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +3 -3
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js +9 -9
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ProfileScreen.js +1 -1
- package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SavesCollectionsScreen.js +4 -4
- package/lib/commonjs/ui/screens/SavesCollectionsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SearchSettingsScreen.js +6 -6
- package/lib/commonjs/ui/screens/SearchSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js +6 -6
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js +4 -4
- package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustRewardsScreen.js +4 -4
- package/lib/commonjs/ui/screens/trust/TrustRewardsScreen.js.map +1 -1
- package/lib/commonjs/ui/utils/activeAuthuser.js +76 -8
- package/lib/commonjs/ui/utils/activeAuthuser.js.map +1 -1
- package/lib/module/index.js +5 -5
- package/lib/module/index.js.map +1 -1
- package/lib/module/ui/components/AccountMenuButton.js +8 -10
- package/lib/module/ui/components/AccountMenuButton.js.map +1 -1
- package/lib/module/ui/components/AccountSwitcher.js +65 -35
- package/lib/module/ui/components/AccountSwitcher.js.map +1 -1
- package/lib/module/ui/components/ProfileButton.js +228 -0
- package/lib/module/ui/components/ProfileButton.js.map +1 -0
- package/lib/module/ui/components/ProfileMenu.js +370 -0
- package/lib/module/ui/components/ProfileMenu.js.map +1 -0
- package/lib/module/ui/context/OxyContext.js +214 -102
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/context/hooks/useAuthOperations.js +29 -2
- package/lib/module/ui/context/hooks/useAuthOperations.js.map +1 -1
- package/lib/module/ui/hooks/queries/useAccountQueries.js +2 -2
- package/lib/module/ui/hooks/queries/useAccountQueries.js.map +1 -1
- package/lib/module/ui/hooks/queries/usePaymentQueries.js +12 -12
- package/lib/module/ui/hooks/queries/usePaymentQueries.js.map +1 -1
- package/lib/module/ui/hooks/queries/useServicesQueries.js +9 -7
- package/lib/module/ui/hooks/queries/useServicesQueries.js.map +1 -1
- package/lib/module/ui/index.js +2 -0
- package/lib/module/ui/index.js.map +1 -1
- package/lib/module/ui/screens/AccountSettingsScreen.js +11 -6
- package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSwitcherScreen.js +3 -3
- package/lib/module/ui/screens/CreateAccountScreen.js +6 -4
- package/lib/module/ui/screens/CreateAccountScreen.js.map +1 -1
- package/lib/module/ui/screens/EditProfileFieldScreen.js +8 -7
- package/lib/module/ui/screens/EditProfileFieldScreen.js.map +1 -1
- package/lib/module/ui/screens/FileManagementScreen.js +13 -13
- package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/HistoryViewScreen.js +7 -7
- package/lib/module/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/module/ui/screens/LanguageSelectorScreen.js +5 -5
- package/lib/module/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/module/ui/screens/ManageAccountScreen.js +17 -18
- package/lib/module/ui/screens/ManageAccountScreen.js.map +1 -1
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js +3 -3
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/module/ui/screens/PrivacySettingsScreen.js +9 -9
- package/lib/module/ui/screens/PrivacySettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/ProfileScreen.js +1 -1
- package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/module/ui/screens/SavesCollectionsScreen.js +4 -4
- package/lib/module/ui/screens/SavesCollectionsScreen.js.map +1 -1
- package/lib/module/ui/screens/SearchSettingsScreen.js +6 -6
- package/lib/module/ui/screens/SearchSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/WelcomeNewUserScreen.js +6 -6
- package/lib/module/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustCenterScreen.js +4 -4
- package/lib/module/ui/screens/trust/TrustCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustRewardsScreen.js +4 -4
- package/lib/module/ui/screens/trust/TrustRewardsScreen.js.map +1 -1
- package/lib/module/ui/utils/activeAuthuser.js +74 -9
- package/lib/module/ui/utils/activeAuthuser.js.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +4 -1
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/AccountMenuButton.d.ts +5 -7
- package/lib/typescript/commonjs/ui/components/AccountMenuButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/AccountSwitcher.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/ActivityIndicator.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/ActivityIndicator.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/CrossFadeIcon.d.ts +2 -1
- package/lib/typescript/commonjs/ui/components/CrossFadeIcon.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/FontLoader.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/FontLoader.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/HelperText.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/HelperText.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/ProfileButton.d.ts +46 -0
- package/lib/typescript/commonjs/ui/components/ProfileButton.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/ProfileMenu.d.ts +39 -0
- package/lib/typescript/commonjs/ui/components/ProfileMenu.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/TextField/Addons/Outline.d.ts +2 -1
- package/lib/typescript/commonjs/ui/components/TextField/Addons/Outline.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/TextField/Addons/Underline.d.ts +2 -1
- package/lib/typescript/commonjs/ui/components/TextField/Addons/Underline.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/TextField/Adornment/TextFieldAffix.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/TextField/Adornment/TextFieldIcon.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/TextField/Label/InputLabel.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/TextField/Label/LabelBackground.d.ts +2 -1
- package/lib/typescript/commonjs/ui/components/TextField/Label/LabelBackground.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/TextField/TextFieldFlat.d.ts +2 -1
- package/lib/typescript/commonjs/ui/components/TextField/TextFieldFlat.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/TextField/TextFieldOutlined.d.ts +2 -1
- package/lib/typescript/commonjs/ui/components/TextField/TextFieldOutlined.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/OxyContext.d.ts +11 -26
- package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/ThemeContext.d.ts +1 -1
- package/lib/typescript/commonjs/ui/context/ThemeContext.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/useServicesQueries.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/index.d.ts +2 -0
- package/lib/typescript/commonjs/ui/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AccountSwitcherScreen.d.ts +3 -3
- package/lib/typescript/commonjs/ui/screens/CreateAccountScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/EditProfileFieldScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/activeAuthuser.d.ts +24 -0
- package/lib/typescript/commonjs/ui/utils/activeAuthuser.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +64 -61
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/client.d.ts +26 -26
- package/lib/typescript/module/ui/client.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/AccountMenuButton.d.ts +5 -7
- package/lib/typescript/module/ui/components/AccountMenuButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/AccountSwitcher.d.ts +1 -1
- package/lib/typescript/module/ui/components/AccountSwitcher.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/ActivityIndicator.d.ts +2 -2
- package/lib/typescript/module/ui/components/ActivityIndicator.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/BottomSheetRouter.d.ts +1 -1
- package/lib/typescript/module/ui/components/BottomSheetRouter.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/CrossFadeIcon.d.ts +4 -3
- package/lib/typescript/module/ui/components/CrossFadeIcon.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/FontLoader.d.ts +1 -1
- package/lib/typescript/module/ui/components/FontLoader.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/HelperText.d.ts +1 -1
- package/lib/typescript/module/ui/components/HelperText.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/Icon.d.ts +1 -1
- package/lib/typescript/module/ui/components/Icon.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/IconButton/IconButton.d.ts +3 -3
- package/lib/typescript/module/ui/components/IconButton/IconButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/IconButton/utils.d.ts +1 -1
- package/lib/typescript/module/ui/components/IconButton/utils.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyPayButton.d.ts +1 -1
- package/lib/typescript/module/ui/components/OxyPayButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyProvider.d.ts +1 -1
- package/lib/typescript/module/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/ProfileButton.d.ts +46 -0
- package/lib/typescript/module/ui/components/ProfileButton.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/ProfileMenu.d.ts +39 -0
- package/lib/typescript/module/ui/components/ProfileMenu.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/StepBasedScreen.d.ts +2 -2
- package/lib/typescript/module/ui/components/StepBasedScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/Surface.d.ts +2 -2
- package/lib/typescript/module/ui/components/Surface.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/TextField/Addons/Outline.d.ts +3 -2
- package/lib/typescript/module/ui/components/TextField/Addons/Outline.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/TextField/Addons/Underline.d.ts +3 -2
- package/lib/typescript/module/ui/components/TextField/Addons/Underline.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/TextField/Adornment/TextFieldAdornment.d.ts +3 -3
- package/lib/typescript/module/ui/components/TextField/Adornment/TextFieldAdornment.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/TextField/Adornment/TextFieldAffix.d.ts +3 -3
- package/lib/typescript/module/ui/components/TextField/Adornment/TextFieldAffix.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/TextField/Adornment/TextFieldIcon.d.ts +4 -4
- package/lib/typescript/module/ui/components/TextField/Adornment/TextFieldIcon.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/TextField/Adornment/types.d.ts +1 -1
- package/lib/typescript/module/ui/components/TextField/Adornment/types.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/TextField/Adornment/utils.d.ts +1 -1
- package/lib/typescript/module/ui/components/TextField/Adornment/utils.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/TextField/Label/InputLabel.d.ts +2 -2
- package/lib/typescript/module/ui/components/TextField/Label/InputLabel.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/TextField/Label/LabelBackground.d.ts +3 -2
- package/lib/typescript/module/ui/components/TextField/Label/LabelBackground.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/TextField/TextFieldFlat.d.ts +3 -2
- package/lib/typescript/module/ui/components/TextField/TextFieldFlat.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/TextField/TextFieldOutlined.d.ts +3 -2
- package/lib/typescript/module/ui/components/TextField/TextFieldOutlined.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/TextField/helpers.d.ts +3 -3
- package/lib/typescript/module/ui/components/TextField/helpers.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/TextField/types.d.ts +1 -1
- package/lib/typescript/module/ui/components/TextField/types.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/TextField.d.ts +4 -4
- package/lib/typescript/module/ui/components/TextField.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/TouchableRipple/TouchableRipple.d.ts +3 -3
- package/lib/typescript/module/ui/components/TouchableRipple/TouchableRipple.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/TouchableRipple/TouchableRipple.native.d.ts +3 -3
- package/lib/typescript/module/ui/components/TouchableRipple/TouchableRipple.native.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/TouchableRipple/utils.d.ts +1 -1
- package/lib/typescript/module/ui/components/TouchableRipple/utils.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/Typography/AnimatedText.d.ts +3 -3
- package/lib/typescript/module/ui/components/Typography/AnimatedText.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/accountMenuRows.d.ts +1 -1
- package/lib/typescript/module/ui/components/accountMenuRows.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/feedback/ProgressIndicator.d.ts +1 -1
- package/lib/typescript/module/ui/components/feedback/ProgressIndicator.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/feedback/constants.d.ts +1 -1
- package/lib/typescript/module/ui/components/feedback/constants.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/feedback/useFeedbackForm.d.ts +1 -1
- package/lib/typescript/module/ui/components/feedback/useFeedbackForm.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/payment/PaymentDetailsStep.d.ts +1 -1
- package/lib/typescript/module/ui/components/payment/PaymentDetailsStep.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/payment/PaymentMethodStep.d.ts +1 -1
- package/lib/typescript/module/ui/components/payment/PaymentMethodStep.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/payment/PaymentReviewStep.d.ts +1 -1
- package/lib/typescript/module/ui/components/payment/PaymentReviewStep.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/payment/PaymentSuccessStep.d.ts +1 -1
- package/lib/typescript/module/ui/components/payment/PaymentSuccessStep.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/payment/PaymentSummaryStep.d.ts +1 -1
- package/lib/typescript/module/ui/components/payment/PaymentSummaryStep.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/payment/constants.d.ts +1 -1
- package/lib/typescript/module/ui/components/payment/constants.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/payment/paymentStyles.d.ts +1 -1
- package/lib/typescript/module/ui/components/payment/paymentStyles.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/theming.d.ts +1 -1
- package/lib/typescript/module/ui/components/theming.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/OxyContext.d.ts +14 -29
- package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/ThemeContext.d.ts +1 -1
- package/lib/typescript/module/ui/context/ThemeContext.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/hooks/useAuthOperations.d.ts +2 -2
- package/lib/typescript/module/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/queries/usePaymentQueries.d.ts +1 -1
- package/lib/typescript/module/ui/hooks/queries/usePaymentQueries.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/queries/useServicesQueries.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/queryClient.d.ts +1 -1
- package/lib/typescript/module/ui/hooks/queryClient.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useAuth.d.ts +1 -1
- package/lib/typescript/module/ui/hooks/useAuth.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useAvatarPicker.d.ts +1 -1
- package/lib/typescript/module/ui/hooks/useAvatarPicker.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useLanguageManagement.d.ts +1 -1
- package/lib/typescript/module/ui/hooks/useLanguageManagement.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useSessionManagement.d.ts +1 -1
- package/lib/typescript/module/ui/hooks/useSessionManagement.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useStorage.d.ts +1 -1
- package/lib/typescript/module/ui/hooks/useStorage.d.ts.map +1 -1
- package/lib/typescript/module/ui/index.d.ts +30 -28
- package/lib/typescript/module/ui/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/navigation/bottomSheetManager.d.ts +1 -1
- package/lib/typescript/module/ui/navigation/bottomSheetManager.d.ts.map +1 -1
- package/lib/typescript/module/ui/navigation/routes.d.ts +1 -1
- package/lib/typescript/module/ui/navigation/routes.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AccountMembersScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/AccountMembersScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AccountSettingsScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AccountSwitcherScreen.d.ts +4 -4
- package/lib/typescript/module/ui/screens/AccountSwitcherScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AccountVerificationScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/AccountVerificationScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AppInfoScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/AppInfoScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AvatarCropScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/AvatarCropScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/ConnectedAppsScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/ConnectedAppsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/CreateAccountScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/CreateAccountScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/EditProfileFieldScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/EditProfileFieldScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/FAQScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/FAQScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/FeedbackScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/FeedbackScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/FileManagementScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/FileManagementScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/FollowersListScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/FollowersListScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/FollowingListScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/FollowingListScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/HelpSupportScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/HelpSupportScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/HistoryViewScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/HistoryViewScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/LanguageSelectorScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/LanguageSelectorScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/LearnMoreUsernamesScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/LearnMoreUsernamesScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/LegalDocumentsScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/LegalDocumentsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/NotificationsScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/NotificationsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/OxyAuthScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/OxyAuthScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/PaymentGatewayScreen.d.ts +2 -2
- package/lib/typescript/module/ui/screens/PaymentGatewayScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/PreferencesScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/PreferencesScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/PremiumSubscriptionScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/PremiumSubscriptionScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/PrivacySettingsScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/PrivacySettingsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/ProfileScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/ProfileScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/SavesCollectionsScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/SavesCollectionsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/SearchSettingsScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/SearchSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/UserLinksScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/UserLinksScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/UserListScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/UserListScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/WelcomeNewUserScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/WelcomeNewUserScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustAboutScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustAboutScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustCenterScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustCenterScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustFAQScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustFAQScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustLeaderboardScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustLeaderboardScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustRewardsScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustRewardsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustRulesScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustRulesScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/server.d.ts +2 -2
- package/lib/typescript/module/ui/server.d.ts.map +1 -1
- package/lib/typescript/module/ui/types/fileManagement.d.ts +1 -1
- package/lib/typescript/module/ui/types/fileManagement.d.ts.map +1 -1
- package/lib/typescript/module/ui/types/navigation.d.ts +1 -1
- package/lib/typescript/module/ui/types/navigation.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/activeAuthuser.d.ts +24 -0
- package/lib/typescript/module/ui/utils/activeAuthuser.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/fileManagement.d.ts +1 -1
- package/lib/typescript/module/ui/utils/fileManagement.d.ts.map +1 -1
- package/package.json +21 -20
- package/src/index.ts +8 -5
- package/src/ui/components/AccountMenuButton.tsx +9 -11
- package/src/ui/components/AccountSwitcher.tsx +71 -37
- package/src/ui/components/ProfileButton.tsx +270 -0
- package/src/ui/components/ProfileMenu.tsx +416 -0
- package/src/ui/context/OxyContext.tsx +217 -130
- package/src/ui/context/hooks/useAuthOperations.ts +35 -2
- package/src/ui/hooks/queries/useAccountQueries.ts +2 -2
- package/src/ui/hooks/queries/usePaymentQueries.ts +12 -12
- package/src/ui/hooks/queries/useServicesQueries.ts +9 -6
- package/src/ui/index.ts +2 -0
- package/src/ui/screens/AccountSettingsScreen.tsx +9 -5
- package/src/ui/screens/AccountSwitcherScreen.tsx +3 -3
- package/src/ui/screens/CreateAccountScreen.tsx +6 -4
- package/src/ui/screens/EditProfileFieldScreen.tsx +8 -7
- package/src/ui/screens/FileManagementScreen.tsx +13 -13
- package/src/ui/screens/HistoryViewScreen.tsx +7 -7
- package/src/ui/screens/LanguageSelectorScreen.tsx +5 -5
- package/src/ui/screens/ManageAccountScreen.tsx +17 -18
- package/src/ui/screens/PremiumSubscriptionScreen.tsx +3 -3
- package/src/ui/screens/PrivacySettingsScreen.tsx +9 -9
- package/src/ui/screens/ProfileScreen.tsx +1 -1
- package/src/ui/screens/SavesCollectionsScreen.tsx +5 -5
- package/src/ui/screens/SearchSettingsScreen.tsx +6 -6
- package/src/ui/screens/WelcomeNewUserScreen.tsx +6 -6
- package/src/ui/screens/trust/TrustCenterScreen.tsx +5 -5
- package/src/ui/screens/trust/TrustRewardsScreen.tsx +4 -4
- package/src/ui/utils/__tests__/activeAuthuser.test.ts +75 -0
- package/src/ui/utils/activeAuthuser.ts +74 -8
- package/lib/commonjs/ui/components/ActiveAccountBanner.js +0 -144
- package/lib/commonjs/ui/components/ActiveAccountBanner.js.map +0 -1
- package/lib/module/ui/components/ActiveAccountBanner.js +0 -141
- package/lib/module/ui/components/ActiveAccountBanner.js.map +0 -1
- package/lib/typescript/commonjs/ui/components/ActiveAccountBanner.d.ts +0 -4
- package/lib/typescript/commonjs/ui/components/ActiveAccountBanner.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/ActiveAccountBanner.d.ts +0 -4
- package/lib/typescript/module/ui/components/ActiveAccountBanner.d.ts.map +0 -1
- package/src/ui/components/ActiveAccountBanner.tsx +0 -130
|
@@ -1092,6 +1092,54 @@ const OxyProvider = ({
|
|
|
1092
1092
|
}, priorSessionReadError);
|
|
1093
1093
|
}
|
|
1094
1094
|
}
|
|
1095
|
+
|
|
1096
|
+
// LAST-ACTIVE-ACCOUNT priority (web multi-account). When the user has an
|
|
1097
|
+
// explicit persisted active slot (`oxy_active_authuser`, written on every
|
|
1098
|
+
// device sign-in / account SWITCH / cookie restore), the multi-account
|
|
1099
|
+
// refresh-cookie restore is the ONLY cold-boot step that honors WHICH slot
|
|
1100
|
+
// was last active — `restoreViaRefreshCookie` selects it via
|
|
1101
|
+
// `selectActiveRefreshAccount(accounts, readActiveAuthuser())`. The
|
|
1102
|
+
// `fedcm-silent` and per-apex `silent-iframe` steps only ever recover the
|
|
1103
|
+
// PRIMARY central IdP session, so if either ran first they would clobber a
|
|
1104
|
+
// switched (managed/org) account back to the primary on reload — the exact
|
|
1105
|
+
// "switch is lost on reload" regression. So when a slot selection exists we
|
|
1106
|
+
// run cookie-restore BEFORE those probes (and disable the later duplicate).
|
|
1107
|
+
//
|
|
1108
|
+
// Read ONCE here (synchronously usable by the step `enabled` gates below).
|
|
1109
|
+
// It is non-null ONLY on first-party web apps that persist the slot. Both the
|
|
1110
|
+
// device sign-in/switch paths AND `handleWebSSOSession` (FedCM/SSO/credentials
|
|
1111
|
+
// commit funnel) now persist it — but only when the session genuinely joined
|
|
1112
|
+
// the device set: `establishDeviceRefreshSlot` returns an `authuser` ONLY on
|
|
1113
|
+
// first-party web (same registrable apex as the API), so a cross-apex RP never
|
|
1114
|
+
// writes a phantom slot and native has no localStorage. Both therefore keep
|
|
1115
|
+
// their existing order untouched. The earlier `stored-session` step still runs
|
|
1116
|
+
// first (FIX-A latency), and when a slot exists but its cookies have all
|
|
1117
|
+
// lapsed, cookie-restore simply returns no accounts and the chain falls through
|
|
1118
|
+
// to the cross-domain fallbacks exactly as before.
|
|
1119
|
+
const prioritizeMultiAccount = (0, _useWebSSO.isWebBrowser)() && (0, _activeAuthuser.readActiveAuthuser)() !== null;
|
|
1120
|
+
|
|
1121
|
+
// DELIBERATELY-SIGNED-OUT gate (web): when the user pressed "Sign out", any
|
|
1122
|
+
// credential that can silently re-mint a session may still be live on the
|
|
1123
|
+
// next reload — the central IdP session (FedCM credential association /
|
|
1124
|
+
// per-apex `fedcm_session` cookie) AND the device refresh cookies. Since
|
|
1125
|
+
// PR #455 the PRIMARY web session also joins the `oxy_rt_<authuser>` device
|
|
1126
|
+
// set, so the un-gated cookie-restore steps would `refresh-all` that still-
|
|
1127
|
+
// present cookie and sign the user back in without intent — exactly the
|
|
1128
|
+
// "sign-out is silently undone" regression. So this flag gates EVERY
|
|
1129
|
+
// AUTOMATIC silent-restore cold-boot step: `stored-session`,
|
|
1130
|
+
// `cookie-restore-active`, `fedcm-silent`, `silent-iframe`, and
|
|
1131
|
+
// `cookie-restore`. The gate — not a cookie wipe — is the authority: the
|
|
1132
|
+
// account may stay "known" for a fast deliberate re-sign-in, but no step
|
|
1133
|
+
// restores it silently while the flag is set. Read the durable flag ONCE here
|
|
1134
|
+
// (synchronously usable by every step `enabled` gate). Any deliberate sign-in
|
|
1135
|
+
// (password, FedCM, account switch, device claim) clears it, so there is no
|
|
1136
|
+
// "stuck signed out" state. The `sso-bounce` step needs no extra gate: it is
|
|
1137
|
+
// already self-suppressed after sign-out (its `hasPriorSession` hint is
|
|
1138
|
+
// cleared). `sso-return` is NOT gated — it commits the result of a deliberate
|
|
1139
|
+
// top-level `/sso` bounce the user just initiated. `shared-key-signin` is
|
|
1140
|
+
// native-only and the flag never sets on native (`markSignedOut` no-ops
|
|
1141
|
+
// off-web), so its gate would be moot; it is left untouched.
|
|
1142
|
+
const silentRestoreBlocked = (0, _activeAuthuser.isSilentRestoreSuppressed)();
|
|
1095
1143
|
try {
|
|
1096
1144
|
const outcome = await (0, _core.runColdBoot)({
|
|
1097
1145
|
steps: [{
|
|
@@ -1112,12 +1160,17 @@ const OxyProvider = ({
|
|
|
1112
1160
|
};
|
|
1113
1161
|
}
|
|
1114
1162
|
}, {
|
|
1115
|
-
// 2) Stored-session bearer restore.
|
|
1116
|
-
//
|
|
1117
|
-
//
|
|
1118
|
-
// common WEB reload winner.
|
|
1163
|
+
// 2) Stored-session bearer restore. Runs on ALL platforms EXCEPT when
|
|
1164
|
+
// the deliberately-signed-out flag is set (web only — it never sets on
|
|
1165
|
+
// native, so native still always reaches exactly this step, its ONLY
|
|
1166
|
+
// restore path). This is also the common WEB reload winner.
|
|
1167
|
+
//
|
|
1168
|
+
// SIGNED-OUT GATE: after a deliberate full sign-out the stored session
|
|
1169
|
+
// state is cleared, so this would normally skip anyway — but the gate
|
|
1170
|
+
// makes that authoritative rather than incidental, so no residual
|
|
1171
|
+
// stored token can silently restore while the user is signed out.
|
|
1119
1172
|
//
|
|
1120
|
-
// ORDERING (FIX A): this step
|
|
1173
|
+
// ORDERING (FIX A): this step runs BEFORE the slow web-only
|
|
1121
1174
|
// probes (`fedcm-silent`, `silent-iframe`, `cookie-restore`). On a
|
|
1122
1175
|
// normal reload the local bearer validates in one round-trip and
|
|
1123
1176
|
// wins; `runColdBoot` then short-circuits and never even evaluates
|
|
@@ -1128,6 +1181,7 @@ const OxyProvider = ({
|
|
|
1128
1181
|
// local session this step skips and the cross-domain fallback chain
|
|
1129
1182
|
// (fedcm → iframe → cookie → sso-bounce) runs exactly as before.
|
|
1130
1183
|
id: 'stored-session',
|
|
1184
|
+
enabled: () => !silentRestoreBlocked,
|
|
1131
1185
|
run: async () => {
|
|
1132
1186
|
const restored = await restoreStoredSession();
|
|
1133
1187
|
if (restored) {
|
|
@@ -1196,6 +1250,38 @@ const OxyProvider = ({
|
|
|
1196
1250
|
session: true
|
|
1197
1251
|
};
|
|
1198
1252
|
}
|
|
1253
|
+
}, {
|
|
1254
|
+
// 2.75) LAST-ACTIVE multi-account restore (WEB, prioritized). Runs
|
|
1255
|
+
// ONLY when an explicit persisted slot selection exists
|
|
1256
|
+
// (`prioritizeMultiAccount`) — i.e. the user previously signed in or
|
|
1257
|
+
// SWITCHED accounts on this first-party app. It runs BEFORE the
|
|
1258
|
+
// `fedcm-silent` / `silent-iframe` probes (which only ever recover the
|
|
1259
|
+
// PRIMARY central session) so a switched managed/org account survives
|
|
1260
|
+
// reload instead of being clobbered back to the primary. The restore
|
|
1261
|
+
// itself is the SAME `restoreViaRefreshCookie` as the terminal-tier
|
|
1262
|
+
// step below: it rotates every device-local `oxy_rt_<authuser>` cookie
|
|
1263
|
+
// and picks the persisted slot via `selectActiveRefreshAccount`,
|
|
1264
|
+
// committing it (token + state + durable persistence + `markAuthResolved`).
|
|
1265
|
+
// When no slot is persisted this is disabled and the original order is
|
|
1266
|
+
// unchanged; when the slot's cookies have lapsed it returns no accounts
|
|
1267
|
+
// and the chain falls through to the cross-domain fallbacks below.
|
|
1268
|
+
//
|
|
1269
|
+
// SIGNED-OUT GATE: since PR #455 the primary's `oxy_rt` slot survives a
|
|
1270
|
+
// deliberate sign-out, so without this gate `refresh-all` would re-mint
|
|
1271
|
+
// and silently re-log-in the user on reload. The flag is cleared by any
|
|
1272
|
+
// deliberate sign-in (including an account SWITCH, which also writes the
|
|
1273
|
+
// new active slot), so the switch-survives-reload path is unaffected.
|
|
1274
|
+
id: 'cookie-restore-active',
|
|
1275
|
+
enabled: () => prioritizeMultiAccount && !silentRestoreBlocked,
|
|
1276
|
+
run: async () => {
|
|
1277
|
+
const restored = await restoreViaRefreshCookie();
|
|
1278
|
+
return restored ? {
|
|
1279
|
+
kind: 'session',
|
|
1280
|
+
session: true
|
|
1281
|
+
} : {
|
|
1282
|
+
kind: 'skip'
|
|
1283
|
+
};
|
|
1284
|
+
}
|
|
1199
1285
|
}, {
|
|
1200
1286
|
// 3) FedCM silent reauthn (Chrome) against the CENTRAL IdP
|
|
1201
1287
|
// (auth.oxy.so). `silentSignInWithFedCM` plants the access token
|
|
@@ -1208,7 +1294,7 @@ const OxyProvider = ({
|
|
|
1208
1294
|
// already recovered a local session — the probe cannot improve on a
|
|
1209
1295
|
// valid local bearer, and skipping it avoids the silent round-trip.
|
|
1210
1296
|
id: 'fedcm-silent',
|
|
1211
|
-
enabled: () => !storedSessionRestored && fedcmSupported && !servicesSilentAttempted.has(silentKey),
|
|
1297
|
+
enabled: () => !storedSessionRestored && !silentRestoreBlocked && fedcmSupported && !servicesSilentAttempted.has(silentKey),
|
|
1212
1298
|
run: async () => {
|
|
1213
1299
|
servicesSilentAttempted.add(silentKey);
|
|
1214
1300
|
const session = await oxyServices.silentSignInWithFedCM?.();
|
|
@@ -1247,7 +1333,7 @@ const OxyProvider = ({
|
|
|
1247
1333
|
// FIX-D: bounded by `SILENT_IFRAME_TIMEOUT` (plus `iframe.onerror`
|
|
1248
1334
|
// fail-fast in core) so a no-message iframe cannot stall cold boot.
|
|
1249
1335
|
id: 'silent-iframe',
|
|
1250
|
-
enabled: () => !storedSessionRestored && (0, _useWebSSO.isWebBrowser)(),
|
|
1336
|
+
enabled: () => !storedSessionRestored && !silentRestoreBlocked && (0, _useWebSSO.isWebBrowser)(),
|
|
1251
1337
|
run: async () => {
|
|
1252
1338
|
if (!commitWebSession) {
|
|
1253
1339
|
return {
|
|
@@ -1279,8 +1365,20 @@ const OxyProvider = ({
|
|
|
1279
1365
|
// is correct; cross-domain restore is handled by the SSO bounce.
|
|
1280
1366
|
// FIX-D: `restoreViaRefreshCookie` bounds the request with
|
|
1281
1367
|
// `COOKIE_RESTORE_TIMEOUT` so a cross-domain stall cannot hang here.
|
|
1368
|
+
//
|
|
1369
|
+
// Disabled when `prioritizeMultiAccount` already ran the
|
|
1370
|
+
// `cookie-restore-active` step above (an explicit persisted slot) — that
|
|
1371
|
+
// earlier step is the identical restore, so this terminal-tier copy
|
|
1372
|
+
// would be a redundant second `refreshAllSessions`. It still runs in the
|
|
1373
|
+
// common no-persisted-slot case (e.g. first visit to a first-party app
|
|
1374
|
+
// whose central refresh cookies already exist).
|
|
1375
|
+
//
|
|
1376
|
+
// SIGNED-OUT GATE (same rationale as `cookie-restore-active`): the
|
|
1377
|
+
// primary's `oxy_rt` slot survives a deliberate sign-out (PR #455), so
|
|
1378
|
+
// this must be skipped while the signed-out flag is set or it would
|
|
1379
|
+
// silently re-restore the primary on reload.
|
|
1282
1380
|
id: 'cookie-restore',
|
|
1283
|
-
enabled: () => (0, _useWebSSO.isWebBrowser)(),
|
|
1381
|
+
enabled: () => (0, _useWebSSO.isWebBrowser)() && !prioritizeMultiAccount && !silentRestoreBlocked,
|
|
1284
1382
|
run: async () => {
|
|
1285
1383
|
const restored = await restoreViaRefreshCookie();
|
|
1286
1384
|
return restored ? {
|
|
@@ -1520,13 +1618,48 @@ const OxyProvider = ({
|
|
|
1520
1618
|
throw new Error('Session response did not include an access token');
|
|
1521
1619
|
}
|
|
1522
1620
|
oxyServices.httpService.setTokens(session.accessToken);
|
|
1621
|
+
|
|
1622
|
+
// A committed web session re-enables automatic silent restore: clear the
|
|
1623
|
+
// durable "deliberately signed out" flag. This funnel is reached by deliberate
|
|
1624
|
+
// sign-ins (password, interactive FedCM, `/sso` return) AND by the silent
|
|
1625
|
+
// cold-boot steps — but those are GATED on the flag, so when it is set they
|
|
1626
|
+
// never run and never reach here; clearing is therefore only hit on a genuine
|
|
1627
|
+
// (re-)sign-in or when restore was already permitted, both correct.
|
|
1628
|
+
(0, _activeAuthuser.clearSignedOut)();
|
|
1629
|
+
|
|
1630
|
+
// Register this primary session in the device's first-party multi-account
|
|
1631
|
+
// refresh-cookie set (web only). Every web primary-session restore funnels
|
|
1632
|
+
// through here — FedCM silent (`/fedcm/exchange`), per-apex `/auth/silent`
|
|
1633
|
+
// iframe, central `/sso` return, and keyless password sign-in. Of those, only
|
|
1634
|
+
// a same-apex `/fedcm/exchange` plants an `oxy_rt_<authuser>` slot as a side
|
|
1635
|
+
// effect; the cross-origin/credential-less restores (`/sso/exchange`,
|
|
1636
|
+
// `/auth/silent` postMessage) cannot set an `api.oxy.so` cookie at all. So
|
|
1637
|
+
// WITHOUT this call a web primary never joins the device set: `refresh-all`
|
|
1638
|
+
// returns zero accounts, and account-switch persistence + the
|
|
1639
|
+
// `cookie-restore-active` cold-boot step have no foundation. Calling the shared
|
|
1640
|
+
// `POST /auth/session` primitive here makes EVERY primary participate in the
|
|
1641
|
+
// set, re-plants the rotated token, and records the active `authuser` so the
|
|
1642
|
+
// next cold boot's `cookie-restore-active` reconciles the persisted active
|
|
1643
|
+
// (possibly switched) account instead of `fedcm-silent` clobbering it back to
|
|
1644
|
+
// the primary. Best-effort: a `null` result (native / transient failure)
|
|
1645
|
+
// leaves the in-session token untouched.
|
|
1646
|
+
const primaryAuthuser = await oxyServices.establishDeviceRefreshSlot();
|
|
1647
|
+
// A non-null slot is returned ONLY on first-party web (the helper gates on
|
|
1648
|
+
// platform + same registrable apex), so recording the active slot here is safe
|
|
1649
|
+
// and never writes a phantom authuser for a cross-apex RP or native.
|
|
1650
|
+
if (typeof primaryAuthuser === 'number') {
|
|
1651
|
+
(0, _activeAuthuser.writeActiveAuthuser)(primaryAuthuser);
|
|
1652
|
+
}
|
|
1523
1653
|
const clientSession = {
|
|
1524
1654
|
sessionId: session.sessionId,
|
|
1525
1655
|
deviceId: session.deviceId || '',
|
|
1526
1656
|
expiresAt: session.expiresAt || new Date(Date.now() + DEFAULT_SESSION_VALIDITY_MS).toISOString(),
|
|
1527
1657
|
lastActive: new Date().toISOString(),
|
|
1528
1658
|
userId: session.user.id?.toString() ?? '',
|
|
1529
|
-
isCurrent: true
|
|
1659
|
+
isCurrent: true,
|
|
1660
|
+
...(typeof primaryAuthuser === 'number' ? {
|
|
1661
|
+
authuser: primaryAuthuser
|
|
1662
|
+
} : null)
|
|
1530
1663
|
};
|
|
1531
1664
|
updateSessions([clientSession], {
|
|
1532
1665
|
merge: true
|
|
@@ -1761,42 +1894,8 @@ const OxyProvider = ({
|
|
|
1761
1894
|
});
|
|
1762
1895
|
|
|
1763
1896
|
// --- Account graph state ---
|
|
1764
|
-
const [actingAs, setActingAsState] = (0, _react.useState)(null);
|
|
1765
1897
|
const [accounts, setAccounts] = (0, _react.useState)([]);
|
|
1766
1898
|
|
|
1767
|
-
// Latest `actingAs`, mirrored into a ref so `refreshAccounts` can reconcile a
|
|
1768
|
-
// stale switch without taking `actingAs` as a dependency (which would re-run
|
|
1769
|
-
// the account load on every switch). See the reconciliation block below.
|
|
1770
|
-
const actingAsRef = (0, _react.useRef)(actingAs);
|
|
1771
|
-
actingAsRef.current = actingAs;
|
|
1772
|
-
// `setActingAs` is declared after `refreshAccounts`; route the reconciliation
|
|
1773
|
-
// clear through a ref so the load callback can call the latest implementation.
|
|
1774
|
-
const setActingAsRef = (0, _react.useRef)(null);
|
|
1775
|
-
|
|
1776
|
-
// Restore actingAs from storage on startup
|
|
1777
|
-
(0, _react.useEffect)(() => {
|
|
1778
|
-
if (!storage || !initialized) return;
|
|
1779
|
-
let mounted = true;
|
|
1780
|
-
(async () => {
|
|
1781
|
-
try {
|
|
1782
|
-
const stored = await storage.getItem(`${storageKeyPrefix}_acting_as`);
|
|
1783
|
-
if (mounted && stored) {
|
|
1784
|
-
setActingAsState(stored);
|
|
1785
|
-
oxyServices.setActingAs(stored);
|
|
1786
|
-
}
|
|
1787
|
-
} catch (err) {
|
|
1788
|
-
if (__DEV__) {
|
|
1789
|
-
_core.logger.debug('Failed to restore actingAs from storage', {
|
|
1790
|
-
component: 'OxyContext'
|
|
1791
|
-
}, err);
|
|
1792
|
-
}
|
|
1793
|
-
}
|
|
1794
|
-
})();
|
|
1795
|
-
return () => {
|
|
1796
|
-
mounted = false;
|
|
1797
|
-
};
|
|
1798
|
-
}, [storage, initialized, storageKeyPrefix, oxyServices]);
|
|
1799
|
-
|
|
1800
1899
|
// Load the unified account graph when authenticated
|
|
1801
1900
|
const refreshAccounts = (0, _react.useCallback)(async () => {
|
|
1802
1901
|
if (!isAuthenticated || !tokenReady || !oxyServices.getAccessToken()) {
|
|
@@ -1806,15 +1905,6 @@ const OxyProvider = ({
|
|
|
1806
1905
|
try {
|
|
1807
1906
|
const list = await oxyServices.listAccounts();
|
|
1808
1907
|
setAccounts(list);
|
|
1809
|
-
// Reconcile a stale switch: if the active account was switched INTO an id
|
|
1810
|
-
// that is no longer accessible (account removed/archived, or it belonged
|
|
1811
|
-
// to a now-inactive sign-in), drop back to the personal account so the
|
|
1812
|
-
// app never keeps sending a dead `X-Acting-As` header. `list` is the
|
|
1813
|
-
// authoritative accessible set on a successful fetch.
|
|
1814
|
-
const current = actingAsRef.current;
|
|
1815
|
-
if (current && !list.some(node => node.accountId === current)) {
|
|
1816
|
-
setActingAsRef.current?.(null);
|
|
1817
|
-
}
|
|
1818
1908
|
} catch (err) {
|
|
1819
1909
|
if (isUnauthorizedStatus(err)) {
|
|
1820
1910
|
setAccounts([]);
|
|
@@ -1833,48 +1923,76 @@ const OxyProvider = ({
|
|
|
1833
1923
|
refreshAccounts();
|
|
1834
1924
|
}
|
|
1835
1925
|
}, [isAuthenticated, initialized, tokenReady, refreshAccounts]);
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1926
|
+
|
|
1927
|
+
// Switch the active session INTO an account from the unified graph. In the
|
|
1928
|
+
// REAL-SESSION model this is identical to switching device sign-ins: mint a
|
|
1929
|
+
// real session for the target and make the whole app that account. The removed
|
|
1930
|
+
// `X-Acting-As` delegation header is gone — `oxyServices.switchToAccount`
|
|
1931
|
+
// plants the minted access token (the refresh token is the server-set httpOnly
|
|
1932
|
+
// `oxy_rt_<authuser>` cookie, so the session joins the device multi-account set
|
|
1933
|
+
// and survives reload / `refresh-all`). We then commit the session into context
|
|
1934
|
+
// state the SAME way sign-in / `switchSession` do, refresh the account graph,
|
|
1935
|
+
// and invalidate every query so all data reloads as the new account.
|
|
1936
|
+
const switchToAccount = (0, _react.useCallback)(async accountId => {
|
|
1937
|
+
const result = await oxyServices.switchToAccount(accountId);
|
|
1938
|
+
if (!result?.user || !result?.sessionId) {
|
|
1939
|
+
throw new Error('Account switch did not return a valid session');
|
|
1940
|
+
}
|
|
1941
|
+
|
|
1942
|
+
// A switch is a deliberate sign-in into an account: re-enable automatic silent
|
|
1943
|
+
// restore by clearing any prior "deliberately signed out" flag.
|
|
1944
|
+
(0, _activeAuthuser.clearSignedOut)();
|
|
1945
|
+
|
|
1946
|
+
// `oxyServices.switchToAccount` already planted `result.accessToken` as the
|
|
1947
|
+
// active token; mirror the minted session into the multi-account store and
|
|
1948
|
+
// mark it current, recording the device `authuser` slot so web silent-switch
|
|
1949
|
+
// and the device account chooser can address it.
|
|
1950
|
+
const now = new Date();
|
|
1951
|
+
const clientSession = {
|
|
1952
|
+
sessionId: result.sessionId,
|
|
1953
|
+
deviceId: result.deviceId || '',
|
|
1954
|
+
expiresAt: result.expiresAt || new Date(now.getTime() + DEFAULT_SESSION_VALIDITY_MS).toISOString(),
|
|
1955
|
+
lastActive: now.toISOString(),
|
|
1956
|
+
userId: result.user.id?.toString() ?? '',
|
|
1957
|
+
isCurrent: true,
|
|
1958
|
+
...(typeof result.authuser === 'number' ? {
|
|
1959
|
+
authuser: result.authuser
|
|
1960
|
+
} : null)
|
|
1961
|
+
};
|
|
1962
|
+
updateSessions([clientSession], {
|
|
1963
|
+
merge: true
|
|
1964
|
+
});
|
|
1965
|
+
setActiveSessionId(result.sessionId);
|
|
1966
|
+
if ((0, _useWebSSO.isWebBrowser)() && typeof result.authuser === 'number') {
|
|
1967
|
+
(0, _activeAuthuser.writeActiveAuthuser)(result.authuser);
|
|
1968
|
+
}
|
|
1969
|
+
await persistSessionDurably(result.sessionId);
|
|
1970
|
+
|
|
1971
|
+
// Fetch the canonical User for the new account (the switch result carries
|
|
1972
|
+
// only MinimalUserData); fall back to that minimal shape if the profile
|
|
1973
|
+
// fetch fails so the app still reflects the switched identity.
|
|
1974
|
+
let fullUser;
|
|
1975
|
+
try {
|
|
1976
|
+
fullUser = await oxyServices.getCurrentUser();
|
|
1977
|
+
} catch (profileError) {
|
|
1978
|
+
if (__DEV__) {
|
|
1979
|
+
_core.logger.debug('Failed to fetch full user after account switch; using switch result user', {
|
|
1980
|
+
component: 'OxyContext',
|
|
1981
|
+
method: 'switchToAccount'
|
|
1982
|
+
}, profileError);
|
|
1860
1983
|
}
|
|
1984
|
+
fullUser = result.user;
|
|
1861
1985
|
}
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
// account's user when a switch is set and resolved, otherwise the signed-in
|
|
1873
|
-
// user's own personal account. Derived (no effect) so identity surfaces always
|
|
1874
|
-
// render the current account without separate syncing. Falls back to `user`
|
|
1875
|
-
// while a just-set switch has not yet resolved in `accounts`, so the header
|
|
1876
|
-
// never flashes empty mid-switch.
|
|
1877
|
-
const activeAccount = (0, _react.useMemo)(() => actingAs && actingAsAccount ? actingAsAccount.account : user, [actingAs, actingAsAccount, user]);
|
|
1986
|
+
loginSuccess(fullUser);
|
|
1987
|
+
onAuthStateChange?.(fullUser);
|
|
1988
|
+
|
|
1989
|
+
// Reload the switchable account graph (the new active account's relationships
|
|
1990
|
+
// differ) and invalidate every query so all data refetches as the new
|
|
1991
|
+
// account — the deviceAccounts probe re-enumerates the multi-account set so
|
|
1992
|
+
// the switched account now appears as a device session.
|
|
1993
|
+
await refreshAccounts();
|
|
1994
|
+
queryClient.invalidateQueries();
|
|
1995
|
+
}, [oxyServices, updateSessions, setActiveSessionId, persistSessionDurably, loginSuccess, onAuthStateChange, refreshAccounts, queryClient]);
|
|
1878
1996
|
const createAccountFn = (0, _react.useCallback)(async data => {
|
|
1879
1997
|
const account = await oxyServices.createAccount(data);
|
|
1880
1998
|
await refreshAccounts();
|
|
@@ -1921,14 +2039,11 @@ const OxyProvider = ({
|
|
|
1921
2039
|
useFollow: useFollowHook,
|
|
1922
2040
|
showBottomSheet: showBottomSheetForContext,
|
|
1923
2041
|
openAvatarPicker,
|
|
1924
|
-
actingAs,
|
|
1925
2042
|
accounts,
|
|
1926
|
-
|
|
1927
|
-
activeAccount,
|
|
1928
|
-
setActingAs,
|
|
2043
|
+
switchToAccount,
|
|
1929
2044
|
refreshAccounts,
|
|
1930
2045
|
createAccount: createAccountFn
|
|
1931
|
-
}), [activeSessionId, signIn, signInWithPassword, handleWebSSOSession, currentLanguage, currentLanguageMetadata, currentLanguageName, currentNativeLanguageName, error, getDeviceSessions, hasAccessToken, canUsePrivateApi, isPrivateApiPending, getPublicKey, hasIdentity, isAuthenticated, isLoading, logout, logoutAll, logoutAllDeviceSessions, oxyServices, storageKeyPrefix, clientId, refreshSessionsWithUser, sessions, setLanguage, storage, switchSessionForContext, tokenReady, hasAccessToken, canUsePrivateApi, isPrivateApiPending, authResolved, updateDeviceName, clearAllAccountData, useFollowHook, user, showBottomSheetForContext, openAvatarPicker,
|
|
2046
|
+
}), [activeSessionId, signIn, signInWithPassword, handleWebSSOSession, currentLanguage, currentLanguageMetadata, currentLanguageName, currentNativeLanguageName, error, getDeviceSessions, hasAccessToken, canUsePrivateApi, isPrivateApiPending, getPublicKey, hasIdentity, isAuthenticated, isLoading, logout, logoutAll, logoutAllDeviceSessions, oxyServices, storageKeyPrefix, clientId, refreshSessionsWithUser, sessions, setLanguage, storage, switchSessionForContext, tokenReady, hasAccessToken, canUsePrivateApi, isPrivateApiPending, authResolved, updateDeviceName, clearAllAccountData, useFollowHook, user, showBottomSheetForContext, openAvatarPicker, accounts, switchToAccount, refreshAccounts, createAccountFn]);
|
|
1932
2047
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(OxyContext.Provider, {
|
|
1933
2048
|
value: contextValue,
|
|
1934
2049
|
children: ssoCallbackIntercepting ? null : children
|
|
@@ -1988,11 +2103,8 @@ const LOADING_STATE = {
|
|
|
1988
2103
|
clientId: null,
|
|
1989
2104
|
oxyServices: LOADING_STATE_OXY_SERVICES,
|
|
1990
2105
|
openAvatarPicker: () => {},
|
|
1991
|
-
actingAs: null,
|
|
1992
2106
|
accounts: [],
|
|
1993
|
-
|
|
1994
|
-
activeAccount: null,
|
|
1995
|
-
setActingAs: () => {},
|
|
2107
|
+
switchToAccount: () => rejectMissingProvider(),
|
|
1996
2108
|
refreshAccounts: () => rejectMissingProvider(),
|
|
1997
2109
|
createAccount: () => rejectMissingProvider()
|
|
1998
2110
|
};
|