@oxyhq/services 5.7.5 → 5.8.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 +76 -76
- package/lib/commonjs/core/index.js +177 -102
- package/lib/commonjs/core/index.js.map +1 -1
- package/lib/commonjs/index.js +88 -29
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/node/createAuth.js +585 -7
- package/lib/commonjs/node/createAuth.js.map +1 -1
- package/lib/commonjs/node/index.js +38 -1
- package/lib/commonjs/node/index.js.map +1 -1
- package/lib/commonjs/ui/components/Avatar.js +15 -6
- package/lib/commonjs/ui/components/Avatar.js.map +1 -1
- package/lib/commonjs/ui/components/GroupedItem.js +58 -13
- package/lib/commonjs/ui/components/GroupedItem.js.map +1 -1
- package/lib/commonjs/ui/components/GroupedSection.js +7 -1
- package/lib/commonjs/ui/components/GroupedSection.js.map +1 -1
- package/lib/commonjs/ui/components/Header.js +322 -0
- package/lib/commonjs/ui/components/Header.js.map +1 -0
- package/lib/commonjs/ui/components/OxyProvider.js +23 -7
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/components/index.js +7 -0
- package/lib/commonjs/ui/components/index.js.map +1 -1
- package/lib/commonjs/ui/components/internal/GroupedPillButtons.js +1 -1
- package/lib/commonjs/ui/components/internal/GroupedPillButtons.js.map +1 -1
- package/lib/commonjs/ui/components/internal/TextField.js +606 -546
- package/lib/commonjs/ui/components/internal/TextField.js.map +1 -1
- package/lib/commonjs/ui/components/internal/TextField.md +436 -0
- package/lib/commonjs/ui/context/OxyContext.js +122 -78
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/hooks/useSessionSocket.js +5 -2
- package/lib/commonjs/ui/hooks/useSessionSocket.js.map +1 -1
- package/lib/commonjs/ui/navigation/OxyRouter.js +1 -1
- package/lib/commonjs/ui/navigation/OxyRouter.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountCenterScreen.js +6 -6
- package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountManagementDemo.js +3 -3
- package/lib/commonjs/ui/screens/AccountManagementDemo.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js +241 -598
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js +1151 -406
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +135 -237
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AppInfoScreen.js +246 -463
- package/lib/commonjs/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FeedbackScreen.js +3 -3
- package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js +808 -650
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/RecoverAccountScreen.js +51 -72
- package/lib/commonjs/ui/screens/RecoverAccountScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SessionManagementScreen.js +11 -29
- package/lib/commonjs/ui/screens/SessionManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SignInScreen.js +30 -303
- package/lib/commonjs/ui/screens/SignInScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SignUpScreen.js +4 -4
- package/lib/commonjs/ui/screens/SignUpScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/internal/SignInPasswordStep.js +19 -31
- package/lib/commonjs/ui/screens/internal/SignInPasswordStep.js.map +1 -1
- package/lib/commonjs/ui/screens/internal/SignInUsernameStep.js +7 -10
- package/lib/commonjs/ui/screens/internal/SignInUsernameStep.js.map +1 -1
- package/lib/commonjs/ui/screens/internal/SignUpIdentityStep.js +11 -5
- package/lib/commonjs/ui/screens/internal/SignUpIdentityStep.js.map +1 -1
- package/lib/commonjs/ui/screens/internal/SignUpSecurityStep.js +11 -4
- package/lib/commonjs/ui/screens/internal/SignUpSecurityStep.js.map +1 -1
- package/lib/commonjs/ui/stores/authStore.js +12 -0
- package/lib/commonjs/ui/stores/authStore.js.map +1 -1
- package/lib/commonjs/ui/styles/authStyles.js +337 -0
- package/lib/commonjs/ui/styles/authStyles.js.map +1 -0
- package/lib/commonjs/ui/styles/index.js +11 -0
- package/lib/commonjs/ui/styles/index.js.map +1 -1
- package/lib/module/core/index.js +177 -41
- package/lib/module/core/index.js.map +1 -1
- package/lib/module/index.js +26 -4
- package/lib/module/index.js.map +1 -1
- package/lib/module/node/createAuth.js +584 -7
- package/lib/module/node/createAuth.js.map +1 -1
- package/lib/module/node/index.js +7 -1
- package/lib/module/node/index.js.map +1 -1
- package/lib/module/ui/components/Avatar.js +15 -6
- package/lib/module/ui/components/Avatar.js.map +1 -1
- package/lib/module/ui/components/GroupedItem.js +59 -14
- package/lib/module/ui/components/GroupedItem.js.map +1 -1
- package/lib/module/ui/components/GroupedSection.js +7 -1
- package/lib/module/ui/components/GroupedSection.js.map +1 -1
- package/lib/module/ui/components/Header.js +317 -0
- package/lib/module/ui/components/Header.js.map +1 -0
- package/lib/module/ui/components/OxyProvider.js +25 -9
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/components/index.js +1 -0
- package/lib/module/ui/components/index.js.map +1 -1
- package/lib/module/ui/components/internal/GroupedPillButtons.js +1 -1
- package/lib/module/ui/components/internal/GroupedPillButtons.js.map +1 -1
- package/lib/module/ui/components/internal/TextField.js +607 -547
- package/lib/module/ui/components/internal/TextField.js.map +1 -1
- package/lib/module/ui/components/internal/TextField.md +436 -0
- package/lib/module/ui/context/OxyContext.js +121 -77
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/hooks/useSessionSocket.js +5 -2
- package/lib/module/ui/hooks/useSessionSocket.js.map +1 -1
- package/lib/module/ui/navigation/OxyRouter.js +1 -1
- package/lib/module/ui/navigation/OxyRouter.js.map +1 -1
- package/lib/module/ui/screens/AccountCenterScreen.js +6 -6
- package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountManagementDemo.js +3 -3
- package/lib/module/ui/screens/AccountManagementDemo.js.map +1 -1
- package/lib/module/ui/screens/AccountOverviewScreen.js +242 -597
- package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSettingsScreen.js +1152 -407
- package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSwitcherScreen.js +135 -237
- package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/module/ui/screens/AppInfoScreen.js +248 -465
- package/lib/module/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/module/ui/screens/FeedbackScreen.js +3 -3
- package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/module/ui/screens/PaymentGatewayScreen.js +809 -651
- package/lib/module/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/module/ui/screens/RecoverAccountScreen.js +53 -74
- package/lib/module/ui/screens/RecoverAccountScreen.js.map +1 -1
- package/lib/module/ui/screens/SessionManagementScreen.js +11 -29
- package/lib/module/ui/screens/SessionManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/SignInScreen.js +32 -305
- package/lib/module/ui/screens/SignInScreen.js.map +1 -1
- package/lib/module/ui/screens/SignUpScreen.js +5 -5
- package/lib/module/ui/screens/SignUpScreen.js.map +1 -1
- package/lib/module/ui/screens/internal/SignInPasswordStep.js +19 -31
- package/lib/module/ui/screens/internal/SignInPasswordStep.js.map +1 -1
- package/lib/module/ui/screens/internal/SignInUsernameStep.js +7 -10
- package/lib/module/ui/screens/internal/SignInUsernameStep.js.map +1 -1
- package/lib/module/ui/screens/internal/SignUpIdentityStep.js +11 -5
- package/lib/module/ui/screens/internal/SignUpIdentityStep.js.map +1 -1
- package/lib/module/ui/screens/internal/SignUpSecurityStep.js +11 -4
- package/lib/module/ui/screens/internal/SignUpSecurityStep.js.map +1 -1
- package/lib/module/ui/stores/authStore.js +12 -0
- package/lib/module/ui/stores/authStore.js.map +1 -1
- package/lib/module/ui/styles/authStyles.js +332 -0
- package/lib/module/ui/styles/authStyles.js.map +1 -0
- package/lib/module/ui/styles/index.js +1 -0
- package/lib/module/ui/styles/index.js.map +1 -1
- package/lib/typescript/core/index.d.ts +68 -24
- package/lib/typescript/core/index.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +13 -3
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/node/createAuth.d.ts +112 -0
- package/lib/typescript/node/createAuth.d.ts.map +1 -1
- package/lib/typescript/node/index.d.ts +2 -0
- package/lib/typescript/node/index.d.ts.map +1 -1
- package/lib/typescript/ui/components/Avatar.d.ts.map +1 -1
- package/lib/typescript/ui/components/GroupedItem.d.ts +6 -0
- package/lib/typescript/ui/components/GroupedItem.d.ts.map +1 -1
- package/lib/typescript/ui/components/GroupedSection.d.ts +6 -0
- package/lib/typescript/ui/components/GroupedSection.d.ts.map +1 -1
- package/lib/typescript/ui/components/Header.d.ts +22 -0
- package/lib/typescript/ui/components/Header.d.ts.map +1 -0
- package/lib/typescript/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/ui/components/index.d.ts +1 -0
- package/lib/typescript/ui/components/index.d.ts.map +1 -1
- package/lib/typescript/ui/components/internal/TextField.d.ts +31 -16
- package/lib/typescript/ui/components/internal/TextField.d.ts.map +1 -1
- package/lib/typescript/ui/context/OxyContext.d.ts +5 -2
- package/lib/typescript/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/ui/hooks/useSessionSocket.d.ts.map +1 -1
- package/lib/typescript/ui/navigation/types.d.ts +9 -2
- package/lib/typescript/ui/navigation/types.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountSwitcherScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AppInfoScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/PaymentGatewayScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/RecoverAccountScreen.d.ts +5 -1
- package/lib/typescript/ui/screens/RecoverAccountScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/SessionManagementScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/SignInScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/internal/SignInPasswordStep.d.ts +1 -1
- package/lib/typescript/ui/screens/internal/SignInPasswordStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/internal/SignInUsernameStep.d.ts +0 -1
- package/lib/typescript/ui/screens/internal/SignInUsernameStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/internal/SignUpIdentityStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/internal/SignUpSecurityStep.d.ts.map +1 -1
- package/lib/typescript/ui/stores/authStore.d.ts.map +1 -1
- package/lib/typescript/ui/styles/authStyles.d.ts +326 -0
- package/lib/typescript/ui/styles/authStyles.d.ts.map +1 -0
- package/lib/typescript/ui/styles/index.d.ts +1 -0
- package/lib/typescript/ui/styles/index.d.ts.map +1 -1
- package/package.json +1 -4
- package/src/core/index.ts +195 -41
- package/src/index.ts +72 -4
- package/src/node/createAuth.ts +623 -7
- package/src/node/index.ts +19 -1
- package/src/ui/components/Avatar.tsx +11 -5
- package/src/ui/components/GroupedItem.tsx +57 -9
- package/src/ui/components/GroupedSection.tsx +12 -0
- package/src/ui/components/Header.tsx +364 -0
- package/src/ui/components/OxyProvider.tsx +31 -15
- package/src/ui/components/index.ts +1 -0
- package/src/ui/components/internal/GroupedPillButtons.tsx +1 -1
- package/src/ui/components/internal/TextField.md +436 -0
- package/src/ui/components/internal/TextField.tsx +720 -620
- package/src/ui/context/OxyContext.tsx +150 -63
- package/src/ui/hooks/useSessionSocket.ts +5 -2
- package/src/ui/navigation/OxyRouter.tsx +1 -1
- package/src/ui/navigation/types.ts +10 -2
- package/src/ui/screens/AccountCenterScreen.tsx +5 -5
- package/src/ui/screens/AccountManagementDemo.tsx +9 -9
- package/src/ui/screens/AccountOverviewScreen.tsx +265 -414
- package/src/ui/screens/AccountSettingsScreen.tsx +1165 -403
- package/src/ui/screens/AccountSwitcherScreen.tsx +158 -202
- package/src/ui/screens/AppInfoScreen.tsx +270 -497
- package/src/ui/screens/FeedbackScreen.tsx +3 -3
- package/src/ui/screens/PaymentGatewayScreen.tsx +668 -365
- package/src/ui/screens/ProfileScreen.tsx +5 -5
- package/src/ui/screens/RecoverAccountScreen.tsx +46 -74
- package/src/ui/screens/SessionManagementScreen.tsx +14 -22
- package/src/ui/screens/SignInScreen.tsx +27 -294
- package/src/ui/screens/SignUpScreen.tsx +5 -5
- package/src/ui/screens/internal/SignInPasswordStep.tsx +11 -22
- package/src/ui/screens/internal/SignInUsernameStep.tsx +3 -10
- package/src/ui/screens/internal/SignUpIdentityStep.tsx +2 -5
- package/src/ui/screens/internal/SignUpSecurityStep.tsx +3 -4
- package/src/ui/stores/authStore.ts +12 -0
- package/src/ui/styles/authStyles.ts +352 -0
- package/src/ui/styles/index.ts +1 -0
- package/lib/commonjs/core/auth-manager.js +0 -440
- package/lib/commonjs/core/auth-manager.js.map +0 -1
- package/lib/commonjs/core/use-auth.js +0 -244
- package/lib/commonjs/core/use-auth.js.map +0 -1
- package/lib/module/core/auth-manager.js +0 -432
- package/lib/module/core/auth-manager.js.map +0 -1
- package/lib/module/core/use-auth.js +0 -235
- package/lib/module/core/use-auth.js.map +0 -1
- package/lib/typescript/core/auth-manager.d.ts +0 -136
- package/lib/typescript/core/auth-manager.d.ts.map +0 -1
- package/lib/typescript/core/use-auth.d.ts +0 -79
- package/lib/typescript/core/use-auth.d.ts.map +0 -1
- package/src/__tests__/middleware.test.ts +0 -105
- package/src/__tests__/setup.ts +0 -10
- package/src/__tests__/zero-config-auth.test.ts +0 -607
- package/src/core/auth-manager.ts +0 -500
- package/src/core/use-auth.tsx +0 -245
|
@@ -29,7 +29,7 @@ const ProfileScreen: React.FC<ProfileScreenProps> = ({ userId, username, theme,
|
|
|
29
29
|
useEffect(() => {
|
|
30
30
|
console.log('ProfileScreen - userId:', userId);
|
|
31
31
|
console.log('ProfileScreen - username:', username);
|
|
32
|
-
|
|
32
|
+
|
|
33
33
|
if (!userId) {
|
|
34
34
|
setError('No user ID provided');
|
|
35
35
|
setIsLoading(false);
|
|
@@ -50,11 +50,11 @@ const ProfileScreen: React.FC<ProfileScreenProps> = ({ userId, username, theme,
|
|
|
50
50
|
}
|
|
51
51
|
throw err;
|
|
52
52
|
}),
|
|
53
|
-
oxyServices.getUserKarmaTotal ?
|
|
53
|
+
oxyServices.getUserKarmaTotal ?
|
|
54
54
|
oxyServices.getUserKarmaTotal(userId).catch(err => {
|
|
55
55
|
console.warn('getUserKarmaTotal error:', err);
|
|
56
56
|
return { total: undefined };
|
|
57
|
-
}) :
|
|
57
|
+
}) :
|
|
58
58
|
Promise.resolve({ total: undefined })
|
|
59
59
|
])
|
|
60
60
|
.then(([profileRes, karmaRes]) => {
|
|
@@ -73,7 +73,7 @@ const ProfileScreen: React.FC<ProfileScreenProps> = ({ userId, username, theme,
|
|
|
73
73
|
console.error('Profile loading error:', err);
|
|
74
74
|
// Provide user-friendly error messages based on the error type
|
|
75
75
|
let errorMessage = 'Failed to load profile';
|
|
76
|
-
|
|
76
|
+
|
|
77
77
|
if (err.status === 404 || err.message?.includes('not found') || err.message?.includes('Resource not found')) {
|
|
78
78
|
if (currentUser && currentUser.id === userId) {
|
|
79
79
|
errorMessage = 'Unable to load your profile from the server. This may be due to a temporary service issue.';
|
|
@@ -87,7 +87,7 @@ const ProfileScreen: React.FC<ProfileScreenProps> = ({ userId, username, theme,
|
|
|
87
87
|
} else if (err.message) {
|
|
88
88
|
errorMessage = err.message;
|
|
89
89
|
}
|
|
90
|
-
|
|
90
|
+
|
|
91
91
|
setError(errorMessage);
|
|
92
92
|
})
|
|
93
93
|
.finally(() => setIsLoading(false));
|
|
@@ -4,17 +4,21 @@ import { Ionicons } from '@expo/vector-icons';
|
|
|
4
4
|
import TextField from '../components/internal/TextField';
|
|
5
5
|
import GroupedPillButtons from '../components/internal/GroupedPillButtons';
|
|
6
6
|
import HighFive from '../../assets/illustrations/HighFive';
|
|
7
|
-
import { useThemeColors } from '../styles';
|
|
7
|
+
import { useThemeColors, createAuthStyles } from '../styles';
|
|
8
8
|
import PinInput from '../components/internal/PinInput';
|
|
9
9
|
|
|
10
10
|
interface RecoverAccountScreenProps {
|
|
11
|
-
navigate: (screen: string) => void;
|
|
11
|
+
navigate: (screen: string, props?: Record<string, any>) => void;
|
|
12
|
+
goBack: () => void;
|
|
12
13
|
theme: string;
|
|
14
|
+
returnTo?: string;
|
|
15
|
+
returnStep?: number;
|
|
16
|
+
returnData?: Record<string, any>;
|
|
13
17
|
}
|
|
14
18
|
|
|
15
19
|
const PIN_LENGTH = 6;
|
|
16
20
|
|
|
17
|
-
const RecoverAccountScreen: React.FC<RecoverAccountScreenProps> = ({ navigate, theme }) => {
|
|
21
|
+
const RecoverAccountScreen: React.FC<RecoverAccountScreenProps> = ({ navigate, goBack, theme, returnTo, returnStep, returnData }) => {
|
|
18
22
|
const [identifier, setIdentifier] = useState('');
|
|
19
23
|
const [isLoading, setIsLoading] = useState(false);
|
|
20
24
|
const [errorMessage, setErrorMessage] = useState('');
|
|
@@ -24,7 +28,7 @@ const RecoverAccountScreen: React.FC<RecoverAccountScreenProps> = ({ navigate, t
|
|
|
24
28
|
const fadeAnim = useRef(new Animated.Value(1)).current;
|
|
25
29
|
const slideAnim = useRef(new Animated.Value(0)).current;
|
|
26
30
|
const colors = useThemeColors(theme as 'light' | 'dark');
|
|
27
|
-
const styles =
|
|
31
|
+
const styles = createAuthStyles(colors, theme);
|
|
28
32
|
const identifierRef = useRef<TextInput>(null);
|
|
29
33
|
const handleRequestWithFocus = () => {
|
|
30
34
|
if (!identifier) {
|
|
@@ -69,6 +73,37 @@ const RecoverAccountScreen: React.FC<RecoverAccountScreenProps> = ({ navigate, t
|
|
|
69
73
|
}, 1200);
|
|
70
74
|
};
|
|
71
75
|
|
|
76
|
+
// Helper function to determine back action based on current step
|
|
77
|
+
const handleBack = () => {
|
|
78
|
+
console.log('RecoverAccount handleBack:', { step, returnTo, returnStep, returnData });
|
|
79
|
+
|
|
80
|
+
if (step === 'code') {
|
|
81
|
+
setStep('request');
|
|
82
|
+
} else if (step === 'done') {
|
|
83
|
+
// If we have return information, use it; otherwise go to SignIn
|
|
84
|
+
if (returnTo && returnStep !== undefined) {
|
|
85
|
+
console.log('Navigating back to', returnTo, 'with step', returnStep, 'and data', returnData);
|
|
86
|
+
navigate(returnTo, {
|
|
87
|
+
initialStep: returnStep,
|
|
88
|
+
...returnData
|
|
89
|
+
});
|
|
90
|
+
} else {
|
|
91
|
+
navigate('SignIn');
|
|
92
|
+
}
|
|
93
|
+
} else {
|
|
94
|
+
// For 'request' step, if we have return information, use it; otherwise go back
|
|
95
|
+
if (returnTo && returnStep !== undefined) {
|
|
96
|
+
console.log('Navigating back to', returnTo, 'with step', returnStep, 'and data', returnData);
|
|
97
|
+
navigate(returnTo, {
|
|
98
|
+
initialStep: returnStep,
|
|
99
|
+
...returnData
|
|
100
|
+
});
|
|
101
|
+
} else {
|
|
102
|
+
goBack();
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
|
|
72
107
|
return (
|
|
73
108
|
<KeyboardAvoidingView
|
|
74
109
|
style={[styles.container, { backgroundColor: colors.background }]}
|
|
@@ -97,25 +132,23 @@ const RecoverAccountScreen: React.FC<RecoverAccountScreenProps> = ({ navigate, t
|
|
|
97
132
|
<TextField
|
|
98
133
|
ref={identifierRef}
|
|
99
134
|
label="Email or Username"
|
|
100
|
-
|
|
135
|
+
leading={<Ionicons name="mail-outline" size={24} color={colors.secondaryText} />}
|
|
101
136
|
value={identifier}
|
|
102
137
|
onChangeText={setIdentifier}
|
|
103
138
|
autoCapitalize="none"
|
|
104
139
|
autoCorrect={false}
|
|
105
|
-
colors={colors}
|
|
106
140
|
variant="filled"
|
|
107
141
|
error={errorMessage || undefined}
|
|
108
142
|
editable={!isLoading}
|
|
109
143
|
autoFocus
|
|
110
144
|
testID="recover-identifier-input"
|
|
111
|
-
validMessage={successMessage || undefined}
|
|
112
145
|
onSubmitEditing={handleRequestWithFocus}
|
|
113
146
|
/>
|
|
114
147
|
<GroupedPillButtons
|
|
115
148
|
buttons={[
|
|
116
149
|
{
|
|
117
|
-
text: 'Back
|
|
118
|
-
onPress:
|
|
150
|
+
text: 'Back',
|
|
151
|
+
onPress: handleBack,
|
|
119
152
|
icon: 'arrow-back',
|
|
120
153
|
variant: 'transparent',
|
|
121
154
|
},
|
|
@@ -155,7 +188,7 @@ const RecoverAccountScreen: React.FC<RecoverAccountScreenProps> = ({ navigate, t
|
|
|
155
188
|
buttons={[
|
|
156
189
|
{
|
|
157
190
|
text: 'Back',
|
|
158
|
-
onPress:
|
|
191
|
+
onPress: handleBack,
|
|
159
192
|
icon: 'arrow-back',
|
|
160
193
|
variant: 'transparent',
|
|
161
194
|
},
|
|
@@ -178,8 +211,8 @@ const RecoverAccountScreen: React.FC<RecoverAccountScreenProps> = ({ navigate, t
|
|
|
178
211
|
<GroupedPillButtons
|
|
179
212
|
buttons={[
|
|
180
213
|
{
|
|
181
|
-
text: 'Back
|
|
182
|
-
onPress:
|
|
214
|
+
text: 'Back',
|
|
215
|
+
onPress: handleBack,
|
|
183
216
|
icon: 'arrow-back',
|
|
184
217
|
variant: 'primary',
|
|
185
218
|
},
|
|
@@ -194,67 +227,6 @@ const RecoverAccountScreen: React.FC<RecoverAccountScreenProps> = ({ navigate, t
|
|
|
194
227
|
);
|
|
195
228
|
};
|
|
196
229
|
|
|
197
|
-
|
|
198
|
-
container: {
|
|
199
|
-
flex: 1,
|
|
200
|
-
},
|
|
201
|
-
scrollContent: {
|
|
202
|
-
flexGrow: 1,
|
|
203
|
-
paddingHorizontal: 24,
|
|
204
|
-
paddingTop: 4,
|
|
205
|
-
paddingBottom: 20,
|
|
206
|
-
},
|
|
207
|
-
stepContainer: {
|
|
208
|
-
flex: 1,
|
|
209
|
-
justifyContent: 'flex-start',
|
|
210
|
-
alignItems: 'flex-start',
|
|
211
|
-
},
|
|
212
|
-
modernHeader: {
|
|
213
|
-
alignItems: 'flex-start',
|
|
214
|
-
width: '100%',
|
|
215
|
-
marginBottom: 24,
|
|
216
|
-
},
|
|
217
|
-
modernTitle: {
|
|
218
|
-
fontFamily: Platform.OS === 'web' ? 'Phudu' : 'Phudu-Bold',
|
|
219
|
-
fontWeight: Platform.OS === 'web' ? 'bold' : undefined,
|
|
220
|
-
fontSize: 62,
|
|
221
|
-
lineHeight: 48,
|
|
222
|
-
marginBottom: 18,
|
|
223
|
-
textAlign: 'left',
|
|
224
|
-
letterSpacing: -1,
|
|
225
|
-
},
|
|
226
|
-
modernSubtitle: {
|
|
227
|
-
fontSize: 18,
|
|
228
|
-
lineHeight: 24,
|
|
229
|
-
textAlign: 'left',
|
|
230
|
-
opacity: 0.8,
|
|
231
|
-
marginBottom: 24,
|
|
232
|
-
},
|
|
233
|
-
successCard: {
|
|
234
|
-
flexDirection: 'row',
|
|
235
|
-
alignItems: 'center',
|
|
236
|
-
padding: 16,
|
|
237
|
-
borderRadius: 16,
|
|
238
|
-
marginBottom: 24,
|
|
239
|
-
gap: 12,
|
|
240
|
-
width: '100%',
|
|
241
|
-
},
|
|
242
|
-
belowInputMessage: {
|
|
243
|
-
flexDirection: 'row',
|
|
244
|
-
alignItems: 'center',
|
|
245
|
-
marginTop: 4,
|
|
246
|
-
marginBottom: 0,
|
|
247
|
-
gap: 6,
|
|
248
|
-
},
|
|
249
|
-
belowInputText: {
|
|
250
|
-
fontSize: 13,
|
|
251
|
-
fontWeight: '500',
|
|
252
|
-
},
|
|
253
|
-
successText: {
|
|
254
|
-
fontSize: 14,
|
|
255
|
-
fontWeight: '500',
|
|
256
|
-
flex: 1,
|
|
257
|
-
},
|
|
258
|
-
});
|
|
230
|
+
|
|
259
231
|
|
|
260
232
|
export default RecoverAccountScreen;
|
|
@@ -15,14 +15,17 @@ import { useOxy } from '../context/OxyContext';
|
|
|
15
15
|
import { fontFamilies } from '../styles/fonts';
|
|
16
16
|
import { toast } from '../../lib/sonner';
|
|
17
17
|
import { Ionicons } from '@expo/vector-icons';
|
|
18
|
+
import OxyIcon from '../components/icon/OxyIcon';
|
|
18
19
|
import { SecureClientSession } from '../../models/secureSession';
|
|
19
20
|
import { confirmAction } from '../utils/confirmAction';
|
|
21
|
+
import { Header } from '../components';
|
|
20
22
|
|
|
21
23
|
const SessionManagementScreen: React.FC<BaseScreenProps> = ({
|
|
22
24
|
onClose,
|
|
23
25
|
theme,
|
|
26
|
+
goBack,
|
|
24
27
|
}) => {
|
|
25
|
-
const { sessions: userSessions, activeSessionId, refreshSessions, logout, oxyServices } = useOxy();
|
|
28
|
+
const { sessions: userSessions, activeSessionId, refreshSessions, logout, logoutAll, oxyServices } = useOxy();
|
|
26
29
|
const [loading, setLoading] = useState(true);
|
|
27
30
|
const [refreshing, setRefreshing] = useState(false);
|
|
28
31
|
const [actionLoading, setActionLoading] = useState<string | null>(null);
|
|
@@ -112,7 +115,7 @@ const SessionManagementScreen: React.FC<BaseScreenProps> = ({
|
|
|
112
115
|
async () => {
|
|
113
116
|
try {
|
|
114
117
|
setActionLoading('all');
|
|
115
|
-
await
|
|
118
|
+
await logoutAll();
|
|
116
119
|
} catch (error) {
|
|
117
120
|
console.error('Logout all sessions failed:', error);
|
|
118
121
|
toast.error('Failed to logout all sessions. Please try again.');
|
|
@@ -166,10 +169,13 @@ const SessionManagementScreen: React.FC<BaseScreenProps> = ({
|
|
|
166
169
|
|
|
167
170
|
return (
|
|
168
171
|
<View style={[styles.container, { backgroundColor }]}>
|
|
169
|
-
<
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
172
|
+
<Header
|
|
173
|
+
title="Active Sessions"
|
|
174
|
+
subtitle="Manage your active sessions across all devices"
|
|
175
|
+
theme={theme}
|
|
176
|
+
onBack={goBack || onClose}
|
|
177
|
+
elevation="subtle"
|
|
178
|
+
/>
|
|
173
179
|
<ScrollView
|
|
174
180
|
style={styles.scrollView}
|
|
175
181
|
contentContainerStyle={styles.scrollContainer}
|
|
@@ -274,22 +280,8 @@ const styles = StyleSheet.create({
|
|
|
274
280
|
justifyContent: 'center',
|
|
275
281
|
alignItems: 'center',
|
|
276
282
|
},
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
paddingBottom: 16,
|
|
280
|
-
},
|
|
281
|
-
title: {
|
|
282
|
-
fontFamily: Platform.OS === 'web'
|
|
283
|
-
? 'Phudu'
|
|
284
|
-
: 'phuduSemiBold',
|
|
285
|
-
fontWeight: Platform.OS === 'web' ? '600' : undefined,
|
|
286
|
-
fontSize: 24,
|
|
287
|
-
marginBottom: 8,
|
|
288
|
-
},
|
|
289
|
-
subtitle: {
|
|
290
|
-
fontSize: 16,
|
|
291
|
-
lineHeight: 20,
|
|
292
|
-
},
|
|
283
|
+
|
|
284
|
+
|
|
293
285
|
scrollView: {
|
|
294
286
|
flex: 1,
|
|
295
287
|
},
|