@oxyhq/services 15.0.0 → 17.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/index.js +25 -55
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/ui/client.js +0 -14
- package/lib/commonjs/ui/client.js.map +1 -1
- package/lib/commonjs/ui/components/OxyAccountDialog.js +764 -0
- package/lib/commonjs/ui/components/OxyAccountDialog.js.map +1 -0
- package/lib/commonjs/ui/components/OxyProvider.js +11 -6
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/components/OxySignInButton.js +10 -21
- package/lib/commonjs/ui/components/OxySignInButton.js.map +1 -1
- package/lib/commonjs/ui/components/ProfileButton.js +25 -112
- package/lib/commonjs/ui/components/ProfileButton.js.map +1 -1
- package/lib/commonjs/ui/components/RequireOxyAuth.js +299 -0
- package/lib/commonjs/ui/components/RequireOxyAuth.js.map +1 -0
- package/lib/commonjs/ui/context/OxyContext.js +106 -2
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/hooks/mutations/mutationKeys.js +1 -1
- package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js +10 -10
- package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js.map +1 -1
- package/lib/commonjs/ui/hooks/queries/queryKeys.js +1 -1
- package/lib/commonjs/ui/hooks/queries/useAccountQueries.js +7 -8
- package/lib/commonjs/ui/hooks/queries/useAccountQueries.js.map +1 -1
- package/lib/commonjs/ui/hooks/useAuth.js +19 -30
- package/lib/commonjs/ui/hooks/useAuth.js.map +1 -1
- package/lib/commonjs/ui/hooks/useSwitchableAccounts.js +37 -267
- package/lib/commonjs/ui/hooks/useSwitchableAccounts.js.map +1 -1
- package/lib/commonjs/ui/index.js +5 -40
- package/lib/commonjs/ui/index.js.map +1 -1
- package/lib/commonjs/ui/navigation/accountDialogManager.js +91 -0
- package/lib/commonjs/ui/navigation/accountDialogManager.js.map +1 -0
- package/lib/commonjs/ui/navigation/routes.js +0 -2
- package/lib/commonjs/ui/navigation/routes.js.map +1 -1
- package/lib/commonjs/ui/screens/ConnectedAppsScreen.js +17 -18
- package/lib/commonjs/ui/screens/ConnectedAppsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ManageAccountScreen.js +4 -3
- package/lib/commonjs/ui/screens/ManageAccountScreen.js.map +1 -1
- package/lib/commonjs/ui/session/createSessionClient.js +10 -2
- package/lib/commonjs/ui/session/createSessionClient.js.map +1 -1
- package/lib/module/index.js +20 -17
- package/lib/module/index.js.map +1 -1
- package/lib/module/ui/client.js +1 -2
- package/lib/module/ui/client.js.map +1 -1
- package/lib/module/ui/components/OxyAccountDialog.js +761 -0
- package/lib/module/ui/components/OxyAccountDialog.js.map +1 -0
- package/lib/module/ui/components/OxyProvider.js +11 -6
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/components/OxySignInButton.js +10 -21
- package/lib/module/ui/components/OxySignInButton.js.map +1 -1
- package/lib/module/ui/components/ProfileButton.js +26 -112
- package/lib/module/ui/components/ProfileButton.js.map +1 -1
- package/lib/module/ui/components/RequireOxyAuth.js +294 -0
- package/lib/module/ui/components/RequireOxyAuth.js.map +1 -0
- package/lib/module/ui/context/OxyContext.js +107 -3
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/hooks/mutations/mutationKeys.js +1 -1
- package/lib/module/ui/hooks/mutations/useAccountMutations.js +8 -8
- package/lib/module/ui/hooks/mutations/useAccountMutations.js.map +1 -1
- package/lib/module/ui/hooks/queries/queryKeys.js +1 -1
- package/lib/module/ui/hooks/queries/useAccountQueries.js +5 -6
- package/lib/module/ui/hooks/queries/useAccountQueries.js.map +1 -1
- package/lib/module/ui/hooks/useAuth.js +19 -30
- package/lib/module/ui/hooks/useAuth.js.map +1 -1
- package/lib/module/ui/hooks/useSwitchableAccounts.js +38 -267
- package/lib/module/ui/hooks/useSwitchableAccounts.js.map +1 -1
- package/lib/module/ui/index.js +1 -5
- package/lib/module/ui/index.js.map +1 -1
- package/lib/module/ui/navigation/accountDialogManager.js +81 -0
- package/lib/module/ui/navigation/accountDialogManager.js.map +1 -0
- package/lib/module/ui/navigation/routes.js +0 -2
- package/lib/module/ui/navigation/routes.js.map +1 -1
- package/lib/module/ui/screens/ConnectedAppsScreen.js +19 -20
- package/lib/module/ui/screens/ConnectedAppsScreen.js.map +1 -1
- package/lib/module/ui/screens/ManageAccountScreen.js +4 -3
- package/lib/module/ui/screens/ManageAccountScreen.js.map +1 -1
- package/lib/module/ui/session/createSessionClient.js +10 -2
- package/lib/module/ui/session/createSessionClient.js.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +6 -13
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/client.d.ts +0 -4
- package/lib/typescript/commonjs/ui/client.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyAccountDialog.d.ts +35 -0
- package/lib/typescript/commonjs/ui/components/OxyAccountDialog.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts +2 -2
- package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxySignInButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/ProfileButton.d.ts +11 -23
- package/lib/typescript/commonjs/ui/components/ProfileButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/RequireOxyAuth.d.ts +55 -0
- package/lib/typescript/commonjs/ui/components/RequireOxyAuth.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/context/OxyContext.d.ts +13 -1
- package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts +4 -4
- package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/useAccountQueries.d.ts +6 -7
- package/lib/typescript/commonjs/ui/hooks/queries/useAccountQueries.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useAuth.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useSwitchableAccounts.d.ts +13 -152
- package/lib/typescript/commonjs/ui/hooks/useSwitchableAccounts.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/index.d.ts +2 -5
- package/lib/typescript/commonjs/ui/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/navigation/accountDialogManager.d.ts +49 -0
- package/lib/typescript/commonjs/ui/navigation/accountDialogManager.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/navigation/routes.d.ts +1 -1
- package/lib/typescript/commonjs/ui/navigation/routes.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/ConnectedAppsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts +1 -1
- package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/session/createSessionClient.d.ts +9 -2
- package/lib/typescript/commonjs/ui/session/createSessionClient.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/types/navigation.d.ts +9 -0
- package/lib/typescript/commonjs/ui/types/navigation.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/storageHelpers.d.ts +7 -7
- package/lib/typescript/module/index.d.ts +6 -13
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/client.d.ts +0 -4
- package/lib/typescript/module/ui/client.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyAccountDialog.d.ts +35 -0
- package/lib/typescript/module/ui/components/OxyAccountDialog.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/OxyProvider.d.ts +2 -2
- package/lib/typescript/module/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxySignInButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/ProfileButton.d.ts +11 -23
- package/lib/typescript/module/ui/components/ProfileButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/RequireOxyAuth.d.ts +55 -0
- package/lib/typescript/module/ui/components/RequireOxyAuth.d.ts.map +1 -0
- package/lib/typescript/module/ui/context/OxyContext.d.ts +13 -1
- package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts +4 -4
- package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/queries/useAccountQueries.d.ts +6 -7
- package/lib/typescript/module/ui/hooks/queries/useAccountQueries.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useAuth.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useSwitchableAccounts.d.ts +13 -152
- package/lib/typescript/module/ui/hooks/useSwitchableAccounts.d.ts.map +1 -1
- package/lib/typescript/module/ui/index.d.ts +2 -5
- package/lib/typescript/module/ui/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/navigation/accountDialogManager.d.ts +49 -0
- package/lib/typescript/module/ui/navigation/accountDialogManager.d.ts.map +1 -0
- 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/ConnectedAppsScreen.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/session/createSessionClient.d.ts +9 -2
- package/lib/typescript/module/ui/session/createSessionClient.d.ts.map +1 -1
- package/lib/typescript/module/ui/types/navigation.d.ts +9 -0
- package/lib/typescript/module/ui/types/navigation.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/storageHelpers.d.ts +7 -7
- package/package.json +4 -4
- package/src/index.ts +23 -28
- package/src/ui/client.ts +0 -4
- package/src/ui/components/OxyAccountDialog.tsx +760 -0
- package/src/ui/components/OxyProvider.tsx +12 -6
- package/src/ui/components/OxySignInButton.tsx +10 -21
- package/src/ui/components/ProfileButton.tsx +23 -126
- package/src/ui/components/RequireOxyAuth.tsx +266 -0
- package/src/ui/context/OxyContext.tsx +146 -7
- package/src/ui/hooks/mutations/mutationKeys.ts +1 -1
- package/src/ui/hooks/mutations/useAccountMutations.ts +8 -8
- package/src/ui/hooks/queries/queryKeys.ts +1 -1
- package/src/ui/hooks/queries/useAccountQueries.ts +8 -9
- package/src/ui/hooks/useAuth.ts +19 -31
- package/src/ui/hooks/useSwitchableAccounts.ts +42 -376
- package/src/ui/index.ts +2 -5
- package/src/ui/navigation/accountDialogManager.ts +84 -0
- package/src/ui/navigation/routes.ts +1 -5
- package/src/ui/screens/ConnectedAppsScreen.tsx +23 -24
- package/src/ui/screens/ManageAccountScreen.tsx +3 -2
- package/src/ui/session/createSessionClient.ts +9 -1
- package/src/ui/types/navigation.ts +9 -0
- package/src/ui/utils/storageHelpers.ts +7 -7
- package/lib/commonjs/ui/components/AccountMenu.js +0 -598
- package/lib/commonjs/ui/components/AccountMenu.js.map +0 -1
- package/lib/commonjs/ui/components/AccountMenuButton.js +0 -135
- package/lib/commonjs/ui/components/AccountMenuButton.js.map +0 -1
- package/lib/commonjs/ui/components/AccountSwitcher.js +0 -780
- package/lib/commonjs/ui/components/AccountSwitcher.js.map +0 -1
- package/lib/commonjs/ui/components/AnotherDeviceQR.js +0 -116
- package/lib/commonjs/ui/components/AnotherDeviceQR.js.map +0 -1
- package/lib/commonjs/ui/components/ProfileMenu.js +0 -518
- package/lib/commonjs/ui/components/ProfileMenu.js.map +0 -1
- package/lib/commonjs/ui/components/SignInAccountChooser.js +0 -189
- package/lib/commonjs/ui/components/SignInAccountChooser.js.map +0 -1
- package/lib/commonjs/ui/components/SignInModal.js +0 -600
- package/lib/commonjs/ui/components/SignInModal.js.map +0 -1
- package/lib/commonjs/ui/hooks/useOxyAuthSession.js +0 -501
- package/lib/commonjs/ui/hooks/useOxyAuthSession.js.map +0 -1
- package/lib/commonjs/ui/hooks/usePasswordSignIn.js +0 -170
- package/lib/commonjs/ui/hooks/usePasswordSignIn.js.map +0 -1
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +0 -51
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +0 -1
- package/lib/commonjs/ui/screens/OxyAuthScreen.js +0 -312
- package/lib/commonjs/ui/screens/OxyAuthScreen.js.map +0 -1
- package/lib/commonjs/utils/deviceFlowSignIn.js +0 -109
- package/lib/commonjs/utils/deviceFlowSignIn.js.map +0 -1
- package/lib/module/ui/components/AccountMenu.js +0 -593
- package/lib/module/ui/components/AccountMenu.js.map +0 -1
- package/lib/module/ui/components/AccountMenuButton.js +0 -130
- package/lib/module/ui/components/AccountMenuButton.js.map +0 -1
- package/lib/module/ui/components/AccountSwitcher.js +0 -774
- package/lib/module/ui/components/AccountSwitcher.js.map +0 -1
- package/lib/module/ui/components/AnotherDeviceQR.js +0 -110
- package/lib/module/ui/components/AnotherDeviceQR.js.map +0 -1
- package/lib/module/ui/components/ProfileMenu.js +0 -514
- package/lib/module/ui/components/ProfileMenu.js.map +0 -1
- package/lib/module/ui/components/SignInAccountChooser.js +0 -183
- package/lib/module/ui/components/SignInAccountChooser.js.map +0 -1
- package/lib/module/ui/components/SignInModal.js +0 -591
- package/lib/module/ui/components/SignInModal.js.map +0 -1
- package/lib/module/ui/hooks/useOxyAuthSession.js +0 -495
- package/lib/module/ui/hooks/useOxyAuthSession.js.map +0 -1
- package/lib/module/ui/hooks/usePasswordSignIn.js +0 -165
- package/lib/module/ui/hooks/usePasswordSignIn.js.map +0 -1
- package/lib/module/ui/screens/AccountSwitcherScreen.js +0 -48
- package/lib/module/ui/screens/AccountSwitcherScreen.js.map +0 -1
- package/lib/module/ui/screens/OxyAuthScreen.js +0 -306
- package/lib/module/ui/screens/OxyAuthScreen.js.map +0 -1
- package/lib/module/utils/deviceFlowSignIn.js +0 -106
- package/lib/module/utils/deviceFlowSignIn.js.map +0 -1
- package/lib/typescript/commonjs/ui/components/AccountMenu.d.ts +0 -47
- package/lib/typescript/commonjs/ui/components/AccountMenu.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/AccountMenuButton.d.ts +0 -26
- package/lib/typescript/commonjs/ui/components/AccountMenuButton.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/AccountSwitcher.d.ts +0 -46
- package/lib/typescript/commonjs/ui/components/AccountSwitcher.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/AnotherDeviceQR.d.ts +0 -34
- package/lib/typescript/commonjs/ui/components/AnotherDeviceQR.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/ProfileMenu.d.ts +0 -49
- package/lib/typescript/commonjs/ui/components/ProfileMenu.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/SignInAccountChooser.d.ts +0 -29
- package/lib/typescript/commonjs/ui/components/SignInAccountChooser.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/SignInModal.d.ts +0 -28
- package/lib/typescript/commonjs/ui/components/SignInModal.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/hooks/useOxyAuthSession.d.ts +0 -105
- package/lib/typescript/commonjs/ui/hooks/useOxyAuthSession.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/hooks/usePasswordSignIn.d.ts +0 -31
- package/lib/typescript/commonjs/ui/hooks/usePasswordSignIn.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/screens/AccountSwitcherScreen.d.ts +0 -11
- package/lib/typescript/commonjs/ui/screens/AccountSwitcherScreen.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/screens/OxyAuthScreen.d.ts +0 -22
- package/lib/typescript/commonjs/ui/screens/OxyAuthScreen.d.ts.map +0 -1
- package/lib/typescript/commonjs/utils/deviceFlowSignIn.d.ts +0 -97
- package/lib/typescript/commonjs/utils/deviceFlowSignIn.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/AccountMenu.d.ts +0 -47
- package/lib/typescript/module/ui/components/AccountMenu.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/AccountMenuButton.d.ts +0 -26
- package/lib/typescript/module/ui/components/AccountMenuButton.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/AccountSwitcher.d.ts +0 -46
- package/lib/typescript/module/ui/components/AccountSwitcher.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/AnotherDeviceQR.d.ts +0 -34
- package/lib/typescript/module/ui/components/AnotherDeviceQR.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/ProfileMenu.d.ts +0 -49
- package/lib/typescript/module/ui/components/ProfileMenu.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/SignInAccountChooser.d.ts +0 -29
- package/lib/typescript/module/ui/components/SignInAccountChooser.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/SignInModal.d.ts +0 -28
- package/lib/typescript/module/ui/components/SignInModal.d.ts.map +0 -1
- package/lib/typescript/module/ui/hooks/useOxyAuthSession.d.ts +0 -105
- package/lib/typescript/module/ui/hooks/useOxyAuthSession.d.ts.map +0 -1
- package/lib/typescript/module/ui/hooks/usePasswordSignIn.d.ts +0 -31
- package/lib/typescript/module/ui/hooks/usePasswordSignIn.d.ts.map +0 -1
- package/lib/typescript/module/ui/screens/AccountSwitcherScreen.d.ts +0 -11
- package/lib/typescript/module/ui/screens/AccountSwitcherScreen.d.ts.map +0 -1
- package/lib/typescript/module/ui/screens/OxyAuthScreen.d.ts +0 -22
- package/lib/typescript/module/ui/screens/OxyAuthScreen.d.ts.map +0 -1
- package/lib/typescript/module/utils/deviceFlowSignIn.d.ts +0 -97
- package/lib/typescript/module/utils/deviceFlowSignIn.d.ts.map +0 -1
- package/src/ui/components/AccountMenu.tsx +0 -645
- package/src/ui/components/AccountMenuButton.tsx +0 -126
- package/src/ui/components/AccountSwitcher.tsx +0 -751
- package/src/ui/components/AnotherDeviceQR.tsx +0 -119
- package/src/ui/components/ProfileMenu.tsx +0 -564
- package/src/ui/components/SignInAccountChooser.tsx +0 -162
- package/src/ui/components/SignInModal.tsx +0 -530
- package/src/ui/hooks/useOxyAuthSession.ts +0 -635
- package/src/ui/hooks/usePasswordSignIn.ts +0 -207
- package/src/ui/screens/AccountSwitcherScreen.tsx +0 -43
- package/src/ui/screens/OxyAuthScreen.tsx +0 -324
- package/src/utils/__tests__/deviceFlowSignIn.test.ts +0 -231
- package/src/utils/deviceFlowSignIn.ts +0 -152
|
@@ -3,7 +3,7 @@ import { ActivityIndicator, FlatList, RefreshControl, StyleSheet, View } from 'r
|
|
|
3
3
|
import { Dialog, toast, useDialogControl } from '@oxyhq/bloom';
|
|
4
4
|
import { useTheme } from '@oxyhq/bloom/theme';
|
|
5
5
|
import { SettingsListGroup, SettingsListItem } from '@oxyhq/bloom/settings-list';
|
|
6
|
-
import type {
|
|
6
|
+
import type { ConnectedApp } from '@oxyhq/core';
|
|
7
7
|
import { logger as loggerUtil } from '@oxyhq/core';
|
|
8
8
|
import type { BaseScreenProps } from '../types/navigation';
|
|
9
9
|
import Header from '../components/Header';
|
|
@@ -12,8 +12,8 @@ import EmptyState from '../components/EmptyState';
|
|
|
12
12
|
import LoadingState from '../components/LoadingState';
|
|
13
13
|
import { useI18n } from '../hooks/useI18n';
|
|
14
14
|
import { useOxy } from '../context/OxyContext';
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
15
|
+
import { useConnectedApps } from '../hooks/queries/useAccountQueries';
|
|
16
|
+
import { useRevokeConnectedApp } from '../hooks/mutations/useAccountMutations';
|
|
17
17
|
|
|
18
18
|
const APP_ICON_SIZE = 40;
|
|
19
19
|
|
|
@@ -39,12 +39,11 @@ const formatRelative = (iso: string): string => {
|
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
|
-
* ConnectedAppsScreen — list and revoke
|
|
42
|
+
* ConnectedAppsScreen — list and revoke connected OAuth applications.
|
|
43
43
|
*
|
|
44
|
-
* Fetches via `
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
* refreshes immediately.
|
|
44
|
+
* Fetches via `useConnectedApps` (drives `GET /auth/grants`) and exposes a
|
|
45
|
+
* "Revoke" action that hits `DELETE /auth/grants/:applicationId`. Each revoke
|
|
46
|
+
* invalidates the connected-apps query so the list refreshes immediately.
|
|
48
47
|
*/
|
|
49
48
|
const ConnectedAppsScreen: React.FC<BaseScreenProps> = ({ onClose, goBack }) => {
|
|
50
49
|
const bloomTheme = useTheme();
|
|
@@ -55,14 +54,14 @@ const ConnectedAppsScreen: React.FC<BaseScreenProps> = ({ onClose, goBack }) =>
|
|
|
55
54
|
isLoading,
|
|
56
55
|
refetch,
|
|
57
56
|
isRefetching,
|
|
58
|
-
} =
|
|
59
|
-
const revokeMutation =
|
|
57
|
+
} = useConnectedApps({ enabled: isAuthenticated });
|
|
58
|
+
const revokeMutation = useRevokeConnectedApp();
|
|
60
59
|
const revokeDialog = useDialogControl();
|
|
61
|
-
const [pendingRevoke, setPendingRevoke] = useState<
|
|
62
|
-
const [
|
|
60
|
+
const [pendingRevoke, setPendingRevoke] = useState<ConnectedApp | null>(null);
|
|
61
|
+
const [revokingAppId, setRevokingAppId] = useState<string | null>(null);
|
|
63
62
|
|
|
64
63
|
const confirmRevoke = useCallback(
|
|
65
|
-
(app:
|
|
64
|
+
(app: ConnectedApp) => {
|
|
66
65
|
setPendingRevoke(app);
|
|
67
66
|
revokeDialog.open();
|
|
68
67
|
},
|
|
@@ -74,16 +73,16 @@ const ConnectedAppsScreen: React.FC<BaseScreenProps> = ({ onClose, goBack }) =>
|
|
|
74
73
|
return;
|
|
75
74
|
}
|
|
76
75
|
const target = pendingRevoke;
|
|
77
|
-
|
|
76
|
+
setRevokingAppId(target.applicationId);
|
|
78
77
|
try {
|
|
79
|
-
await revokeMutation.mutateAsync(target.
|
|
78
|
+
await revokeMutation.mutateAsync(target.applicationId);
|
|
80
79
|
toast.success(
|
|
81
80
|
t('connectedApps.toasts.revoked', { name: target.name })
|
|
82
81
|
|| `Revoked access for ${target.name}`,
|
|
83
82
|
);
|
|
84
83
|
} catch (error) {
|
|
85
84
|
loggerUtil.warn(
|
|
86
|
-
'Revoke
|
|
85
|
+
'Revoke connected app failed',
|
|
87
86
|
{ component: 'ConnectedAppsScreen' },
|
|
88
87
|
error,
|
|
89
88
|
);
|
|
@@ -92,7 +91,7 @@ const ConnectedAppsScreen: React.FC<BaseScreenProps> = ({ onClose, goBack }) =>
|
|
|
92
91
|
|| 'Failed to revoke access',
|
|
93
92
|
);
|
|
94
93
|
} finally {
|
|
95
|
-
|
|
94
|
+
setRevokingAppId(null);
|
|
96
95
|
setPendingRevoke(null);
|
|
97
96
|
}
|
|
98
97
|
}, [pendingRevoke, revokeMutation, t]);
|
|
@@ -113,18 +112,18 @@ const ConnectedAppsScreen: React.FC<BaseScreenProps> = ({ onClose, goBack }) =>
|
|
|
113
112
|
);
|
|
114
113
|
|
|
115
114
|
const renderItem = useCallback(
|
|
116
|
-
({ item }: { item:
|
|
117
|
-
const isRevoking =
|
|
115
|
+
({ item }: { item: ConnectedApp }) => {
|
|
116
|
+
const isRevoking = revokingAppId === item.applicationId;
|
|
118
117
|
return (
|
|
119
118
|
<SettingsListGroup>
|
|
120
119
|
<SettingsListItem
|
|
121
120
|
icon={<Avatar name={item.name} size={APP_ICON_SIZE} />}
|
|
122
121
|
title={item.name}
|
|
123
122
|
description={
|
|
124
|
-
t('connectedApps.item.
|
|
125
|
-
relative: formatRelative(item.
|
|
123
|
+
t('connectedApps.item.granted', {
|
|
124
|
+
relative: formatRelative(item.firstGrantedAt),
|
|
126
125
|
})
|
|
127
|
-
|| `
|
|
126
|
+
|| `Granted ${formatRelative(item.firstGrantedAt)}`
|
|
128
127
|
}
|
|
129
128
|
onPress={isRevoking ? undefined : () => confirmRevoke(item)}
|
|
130
129
|
disabled={isRevoking}
|
|
@@ -142,7 +141,7 @@ const ConnectedAppsScreen: React.FC<BaseScreenProps> = ({ onClose, goBack }) =>
|
|
|
142
141
|
</SettingsListGroup>
|
|
143
142
|
);
|
|
144
143
|
},
|
|
145
|
-
[bloomTheme.colors.error, confirmRevoke,
|
|
144
|
+
[bloomTheme.colors.error, confirmRevoke, revokingAppId, t],
|
|
146
145
|
);
|
|
147
146
|
|
|
148
147
|
return (
|
|
@@ -158,7 +157,7 @@ const ConnectedAppsScreen: React.FC<BaseScreenProps> = ({ onClose, goBack }) =>
|
|
|
158
157
|
) : (
|
|
159
158
|
<FlatList
|
|
160
159
|
data={apps ?? []}
|
|
161
|
-
keyExtractor={(item) => item.
|
|
160
|
+
keyExtractor={(item) => item.applicationId}
|
|
162
161
|
renderItem={renderItem}
|
|
163
162
|
contentContainerClassName="px-screen-margin py-space-16"
|
|
164
163
|
contentContainerStyle={styles.listContent}
|
|
@@ -78,7 +78,7 @@ const formatRelative = (dateString?: string): string => {
|
|
|
78
78
|
* Replaces AccountOverview + AccountSettings + the per-account half of
|
|
79
79
|
* SessionManagement. Lists ONLY the active user's profile, sessions on this
|
|
80
80
|
* device, and security/destructive actions for THIS account. Multi-account
|
|
81
|
-
* surface lives in
|
|
81
|
+
* surface lives in the unified `OxyAccountDialog` — keep these concerns separate.
|
|
82
82
|
*/
|
|
83
83
|
const ManageAccountScreen: React.FC<BaseScreenProps> = ({
|
|
84
84
|
onClose,
|
|
@@ -95,6 +95,7 @@ const ManageAccountScreen: React.FC<BaseScreenProps> = ({
|
|
|
95
95
|
logout,
|
|
96
96
|
openAvatarPicker,
|
|
97
97
|
accounts,
|
|
98
|
+
openAccountDialog,
|
|
98
99
|
} = useOxy();
|
|
99
100
|
|
|
100
101
|
const { data: userFromQuery, isLoading: userLoading } = useCurrentUser({
|
|
@@ -700,7 +701,7 @@ const ManageAccountScreen: React.FC<BaseScreenProps> = ({
|
|
|
700
701
|
|| 'Accounts you own or share'
|
|
701
702
|
)
|
|
702
703
|
}
|
|
703
|
-
onPress={() =>
|
|
704
|
+
onPress={() => openAccountDialog('accounts')}
|
|
704
705
|
/>
|
|
705
706
|
<SettingsListItem
|
|
706
707
|
icon={
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
createSessionClientHost,
|
|
5
5
|
type AuthStateStore,
|
|
6
6
|
type OxyServices,
|
|
7
|
+
type SessionClientOptions,
|
|
7
8
|
} from '@oxyhq/core';
|
|
8
9
|
import { createTokenTransport } from './tokenTransport';
|
|
9
10
|
|
|
@@ -31,12 +32,19 @@ export function createSessionClient(
|
|
|
31
32
|
oxyServices: OxyServices,
|
|
32
33
|
store: AuthStateStore,
|
|
33
34
|
onUnauthenticated?: () => void,
|
|
35
|
+
/**
|
|
36
|
+
* Optional signed-out realtime wiring: `signedOutSocketAuth` (open the socket
|
|
37
|
+
* while signed out — web returns `true` to ride the `oxy_device` cookie,
|
|
38
|
+
* native returns the shared device token) and `onSessionAppeared` (self-acquire
|
|
39
|
+
* when a sibling signs in on this device).
|
|
40
|
+
*/
|
|
41
|
+
extra?: Pick<SessionClientOptions, 'signedOutSocketAuth' | 'onSessionAppeared'>,
|
|
34
42
|
): {
|
|
35
43
|
client: SessionClient;
|
|
36
44
|
host: ReturnType<typeof createSessionClientHost>;
|
|
37
45
|
} {
|
|
38
46
|
const host = createSessionClientHost(oxyServices);
|
|
39
47
|
const transport = createTokenTransport(oxyServices, store);
|
|
40
|
-
const client = new SessionClient(host, { transport, socketFactory: io, onUnauthenticated });
|
|
48
|
+
const client = new SessionClient(host, { transport, socketFactory: io, onUnauthenticated, ...extra });
|
|
41
49
|
return { client, host };
|
|
42
50
|
}
|
|
@@ -63,4 +63,13 @@ export interface OxyProviderProps {
|
|
|
63
63
|
authWebUrl?: string;
|
|
64
64
|
authRedirectUri?: string;
|
|
65
65
|
queryClient?: QueryClient;
|
|
66
|
+
/**
|
|
67
|
+
* Convenience: wrap the whole app subtree in `<RequireOxyAuth prompt=...>`.
|
|
68
|
+
* `off` (default) renders children unconditionally; `soft` adds a dismissible
|
|
69
|
+
* sign-in banner while signed out; `hard` blocks the app behind the signed-out
|
|
70
|
+
* wall until the user signs in. For finer control, mount `RequireOxyAuth`
|
|
71
|
+
* yourself around a specific subtree instead.
|
|
72
|
+
* @default 'off'
|
|
73
|
+
*/
|
|
74
|
+
requireAuth?: 'off' | 'soft' | 'hard';
|
|
66
75
|
}
|
|
@@ -11,13 +11,13 @@ export interface SessionStorageKeys {
|
|
|
11
11
|
language: string;
|
|
12
12
|
/**
|
|
13
13
|
* DURABLE "this device/app has had a signed-in Oxy session before" hint.
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
14
|
+
* Originally read at cold boot to drive the FedCM-era smart `sso-bounce`
|
|
15
|
+
* gate (a returning visitor still got one establish bounce; a first-time
|
|
16
|
+
* anonymous visitor was never force-redirected). That gate and
|
|
17
|
+
* `allowSsoBounce` were deleted in the device-first cutover — this storage
|
|
18
|
+
* key is currently defined but not read anywhere; kept rather than removed
|
|
19
|
+
* here since deleting a storage key is a logic change, out of scope for a
|
|
20
|
+
* comment sweep. Flag for a follow-up dead-field cleanup.
|
|
21
21
|
*/
|
|
22
22
|
priorSession: string;
|
|
23
23
|
}
|