@onairos/react-native 3.0.66 โ 3.0.67
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/components/EmailVerificationModal.js +7 -6
- package/lib/commonjs/components/EmailVerificationModal.js.map +1 -1
- package/lib/commonjs/components/TrainingModal.js +17 -9
- package/lib/commonjs/components/TrainingModal.js.map +1 -1
- package/lib/commonjs/components/UniversalOnboarding.js +9 -9
- package/lib/commonjs/components/UniversalOnboarding.js.map +1 -1
- package/lib/commonjs/services/platformAuthService.js +80 -40
- package/lib/commonjs/services/platformAuthService.js.map +1 -1
- package/lib/module/components/EmailVerificationModal.js +7 -6
- package/lib/module/components/EmailVerificationModal.js.map +1 -1
- package/lib/module/components/TrainingModal.js +17 -9
- package/lib/module/components/TrainingModal.js.map +1 -1
- package/lib/module/components/UniversalOnboarding.js +9 -9
- package/lib/module/components/UniversalOnboarding.js.map +1 -1
- package/lib/module/services/platformAuthService.js +80 -40
- package/lib/module/services/platformAuthService.js.map +1 -1
- package/lib/typescript/components/EmailVerificationModal.d.ts +1 -0
- package/lib/typescript/components/EmailVerificationModal.d.ts.map +1 -1
- package/lib/typescript/components/TrainingModal.d.ts.map +1 -1
- package/lib/typescript/components/UniversalOnboarding.d.ts.map +1 -1
- package/lib/typescript/services/platformAuthService.d.ts +4 -3
- package/lib/typescript/services/platformAuthService.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/EmailVerificationModal.tsx +10 -6
- package/src/components/TrainingModal.tsx +77 -67
- package/src/components/UniversalOnboarding.tsx +13 -11
- package/src/services/platformAuthService.ts +86 -38
|
@@ -20,6 +20,7 @@ export interface EmailVerificationModalProps {
|
|
|
20
20
|
onClose: () => void;
|
|
21
21
|
onVerificationComplete: (email: string, isExistingUser: boolean) => void;
|
|
22
22
|
onVerificationFailed: (error: string) => void;
|
|
23
|
+
testMode?: boolean;
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
export const EmailVerificationModal: React.FC<EmailVerificationModalProps> = ({
|
|
@@ -28,6 +29,7 @@ export const EmailVerificationModal: React.FC<EmailVerificationModalProps> = ({
|
|
|
28
29
|
onClose,
|
|
29
30
|
onVerificationComplete,
|
|
30
31
|
onVerificationFailed,
|
|
32
|
+
testMode = false,
|
|
31
33
|
}) => {
|
|
32
34
|
const [step, setStep] = useState<'request' | 'verify'>('request');
|
|
33
35
|
const [verificationCode, setVerificationCode] = useState<string>('');
|
|
@@ -45,7 +47,7 @@ export const EmailVerificationModal: React.FC<EmailVerificationModalProps> = ({
|
|
|
45
47
|
console.log('๐ง Requesting email verification for:', email);
|
|
46
48
|
|
|
47
49
|
// First check if there's already a pending verification
|
|
48
|
-
const statusCheck = await checkEmailVerificationStatus(email);
|
|
50
|
+
const statusCheck = await checkEmailVerificationStatus(email, testMode);
|
|
49
51
|
if (statusCheck.success && statusCheck.isPending) {
|
|
50
52
|
console.log('โ
Email verification already pending');
|
|
51
53
|
setCodeSent(true);
|
|
@@ -55,7 +57,7 @@ export const EmailVerificationModal: React.FC<EmailVerificationModalProps> = ({
|
|
|
55
57
|
}
|
|
56
58
|
|
|
57
59
|
// Request new verification code
|
|
58
|
-
const result = await requestEmailVerification(email);
|
|
60
|
+
const result = await requestEmailVerification(email, testMode);
|
|
59
61
|
|
|
60
62
|
if (result.success) {
|
|
61
63
|
console.log('โ
Email verification code requested successfully');
|
|
@@ -91,7 +93,7 @@ export const EmailVerificationModal: React.FC<EmailVerificationModalProps> = ({
|
|
|
91
93
|
try {
|
|
92
94
|
console.log('๐ Verifying email code for:', email);
|
|
93
95
|
|
|
94
|
-
const result = await verifyEmailCode(email, verificationCode.trim());
|
|
96
|
+
const result = await verifyEmailCode(email, verificationCode.trim(), testMode);
|
|
95
97
|
|
|
96
98
|
if (result.success) {
|
|
97
99
|
console.log('โ
Email verification successful');
|
|
@@ -190,9 +192,11 @@ export const EmailVerificationModal: React.FC<EmailVerificationModalProps> = ({
|
|
|
190
192
|
We've sent a 6-digit code to {email}
|
|
191
193
|
</Text>
|
|
192
194
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
195
|
+
{testMode && (
|
|
196
|
+
<Text style={styles.testingNote}>
|
|
197
|
+
๐ Test Mode: Any 6-digit code will work for verification
|
|
198
|
+
</Text>
|
|
199
|
+
)}
|
|
196
200
|
|
|
197
201
|
<TextInput
|
|
198
202
|
style={styles.codeInput}
|
|
@@ -63,6 +63,7 @@ export const TrainingModal: React.FC<TrainingModalProps> = ({
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
console.log('๐ Starting Enoch training with socketId:', socketId);
|
|
66
|
+
console.log('๐ Production mode: Using live training API');
|
|
66
67
|
|
|
67
68
|
// Prepare user data for training
|
|
68
69
|
const trainingData = {
|
|
@@ -95,16 +96,18 @@ export const TrainingModal: React.FC<TrainingModalProps> = ({
|
|
|
95
96
|
console.error('Training start failed:', result.error);
|
|
96
97
|
setTrainingStatus(`Error: ${result.error}`);
|
|
97
98
|
setHasError(true);
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
setInternalProgress(20);
|
|
99
|
+
|
|
100
|
+
// In production mode, don't fallback to simulation on API failure
|
|
101
|
+
console.error('๐จ Production mode: Training failed, not falling back to simulation');
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
} catch (error) {
|
|
105
105
|
console.error('Training start error:', error);
|
|
106
106
|
setTrainingStatus(`Error: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
107
107
|
setHasError(true);
|
|
108
|
+
|
|
109
|
+
// In production mode, show the actual error
|
|
110
|
+
console.error('๐จ Production mode: Training failed with error:', error);
|
|
108
111
|
}
|
|
109
112
|
};
|
|
110
113
|
|
|
@@ -170,72 +173,79 @@ export const TrainingModal: React.FC<TrainingModalProps> = ({
|
|
|
170
173
|
|
|
171
174
|
// Initialize real socket connection - backend confirmed this is working
|
|
172
175
|
try {
|
|
173
|
-
|
|
174
|
-
socketRef.current = io('https://api2.onairos.uk', {
|
|
175
|
-
transports: ['websocket'],
|
|
176
|
-
autoConnect: false
|
|
177
|
-
});
|
|
178
|
-
|
|
179
|
-
// Socket event listeners
|
|
180
|
-
socketRef.current.on('connect', () => {
|
|
181
|
-
console.log('โ
Socket connected for training');
|
|
182
|
-
setSocketConnected(true);
|
|
183
|
-
const socketId = socketRef.current?.id;
|
|
184
|
-
if (socketId) {
|
|
185
|
-
startEnochTraining(socketId);
|
|
186
|
-
}
|
|
187
|
-
});
|
|
188
|
-
|
|
189
|
-
socketRef.current.on('disconnect', () => {
|
|
190
|
-
console.log('โ Socket disconnected');
|
|
191
|
-
setSocketConnected(false);
|
|
192
|
-
});
|
|
193
|
-
|
|
194
|
-
socketRef.current.on('trainingCompleted', (data) => {
|
|
195
|
-
console.log('โ
Training Complete:', data);
|
|
196
|
-
setTrainingStatus('Running test inference...');
|
|
197
|
-
setInternalProgress(60);
|
|
198
|
-
});
|
|
199
|
-
|
|
200
|
-
socketRef.current.on('inferenceCompleted', (data) => {
|
|
201
|
-
console.log('๐ง Inference Complete:', data);
|
|
202
|
-
setTrainingStatus('Uploading to S3...');
|
|
203
|
-
setInternalProgress(80);
|
|
204
|
-
setUserTraits(data.traits);
|
|
205
|
-
setInferenceResults(data.inferenceResults);
|
|
206
|
-
});
|
|
207
|
-
|
|
208
|
-
socketRef.current.on('modelStandby', (data) => {
|
|
209
|
-
console.log('๐ All Complete:', data);
|
|
210
|
-
setIsTrainingComplete(true);
|
|
211
|
-
setTrainingStatus('Complete!');
|
|
212
|
-
setInternalProgress(100);
|
|
176
|
+
console.log('๐ Production mode: Initializing real socket connection');
|
|
213
177
|
|
|
214
|
-
//
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
console.
|
|
223
|
-
|
|
178
|
+
// Initialize socket connection
|
|
179
|
+
socketRef.current = io('https://api2.onairos.uk', {
|
|
180
|
+
transports: ['websocket'],
|
|
181
|
+
autoConnect: false
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
// Socket event listeners
|
|
185
|
+
socketRef.current.on('connect', () => {
|
|
186
|
+
console.log('โ
Socket connected for training');
|
|
187
|
+
setSocketConnected(true);
|
|
188
|
+
const socketId = socketRef.current?.id;
|
|
189
|
+
if (socketId) {
|
|
190
|
+
startEnochTraining(socketId);
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
socketRef.current.on('disconnect', () => {
|
|
195
|
+
console.log('โ Socket disconnected');
|
|
196
|
+
setSocketConnected(false);
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
socketRef.current.on('connect_error', (error) => {
|
|
200
|
+
console.error('โ Socket connection error:', error);
|
|
201
|
+
setTrainingStatus('Connection failed');
|
|
224
202
|
setHasError(true);
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
socketRef.current.on('trainingCompleted', (data) => {
|
|
206
|
+
console.log('โ
Training Complete:', data);
|
|
207
|
+
setTrainingStatus('Running test inference...');
|
|
208
|
+
setInternalProgress(60);
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
socketRef.current.on('inferenceCompleted', (data) => {
|
|
212
|
+
console.log('๐ง Inference Complete:', data);
|
|
213
|
+
setTrainingStatus('Uploading to S3...');
|
|
214
|
+
setInternalProgress(80);
|
|
215
|
+
setUserTraits(data.traits);
|
|
216
|
+
setInferenceResults(data.inferenceResults);
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
socketRef.current.on('modelStandby', (data) => {
|
|
220
|
+
console.log('๐ All Complete:', data);
|
|
221
|
+
setIsTrainingComplete(true);
|
|
222
|
+
setTrainingStatus('Complete!');
|
|
223
|
+
setInternalProgress(100);
|
|
224
|
+
|
|
225
|
+
// Auto-complete after a short delay
|
|
226
|
+
setTimeout(() => {
|
|
227
|
+
onComplete && onComplete();
|
|
228
|
+
}, 1500);
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
socketRef.current.on('trainingUpdate', (data) => {
|
|
232
|
+
if (data.error) {
|
|
233
|
+
console.error('Training update error:', data.error);
|
|
234
|
+
setTrainingStatus(`Error: ${data.error}`);
|
|
235
|
+
setHasError(true);
|
|
236
|
+
} else if (data.progress) {
|
|
237
|
+
setInternalProgress(data.progress);
|
|
238
|
+
setTrainingStatus(data.status || 'Training in progress...');
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
|
|
242
|
+
// Connect to socket
|
|
243
|
+
socketRef.current.connect();
|
|
244
|
+
|
|
233
245
|
} catch (socketError) {
|
|
234
|
-
console.error('Socket connection failed
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
setSocketConnected(true);
|
|
238
|
-
simulateTraining();
|
|
246
|
+
console.error('๐จ Production mode: Socket connection failed:', socketError);
|
|
247
|
+
setTrainingStatus('Failed to connect to training service');
|
|
248
|
+
setHasError(true);
|
|
239
249
|
}
|
|
240
250
|
|
|
241
251
|
// Cleanup function
|
|
@@ -503,9 +503,9 @@ export const UniversalOnboarding: React.FC<UniversalOnboardingProps> = ({
|
|
|
503
503
|
|
|
504
504
|
console.log('๐ง Email validation passed, proceeding...');
|
|
505
505
|
|
|
506
|
-
// For
|
|
507
|
-
if (
|
|
508
|
-
console.log('๐งช
|
|
506
|
+
// For test mode, just proceed to verification step without API call
|
|
507
|
+
if (isTestMode) {
|
|
508
|
+
console.log('๐งช Test mode: Skipping API call, proceeding to verification');
|
|
509
509
|
setStep('verify');
|
|
510
510
|
return;
|
|
511
511
|
}
|
|
@@ -538,7 +538,7 @@ export const UniversalOnboarding: React.FC<UniversalOnboardingProps> = ({
|
|
|
538
538
|
|
|
539
539
|
// Race between API call and timeout
|
|
540
540
|
const result = await Promise.race([
|
|
541
|
-
requestEmailVerification(email.trim()),
|
|
541
|
+
requestEmailVerification(email.trim(), isTestMode),
|
|
542
542
|
timeoutPromise
|
|
543
543
|
]) as any;
|
|
544
544
|
|
|
@@ -610,14 +610,14 @@ export const UniversalOnboarding: React.FC<UniversalOnboardingProps> = ({
|
|
|
610
610
|
}
|
|
611
611
|
}
|
|
612
612
|
|
|
613
|
-
// Real API call (production)
|
|
614
|
-
const result = await verifyEmailCode(email.trim(), verificationCode.trim());
|
|
613
|
+
// Real API call (production) or test mode
|
|
614
|
+
const result = await verifyEmailCode(email.trim(), verificationCode.trim(), isTestMode);
|
|
615
615
|
|
|
616
616
|
if (result.success) {
|
|
617
617
|
console.log('โ
Email verification successful');
|
|
618
618
|
|
|
619
|
-
|
|
620
|
-
|
|
619
|
+
// Check if user exists in backend (properly typed now)
|
|
620
|
+
const existingUser = result.existingUser || false;
|
|
621
621
|
setIsExistingUser(existingUser);
|
|
622
622
|
|
|
623
623
|
if (existingUser) {
|
|
@@ -844,9 +844,11 @@ export const UniversalOnboarding: React.FC<UniversalOnboardingProps> = ({
|
|
|
844
844
|
<Text style={styles.emailSubtitle}>
|
|
845
845
|
We've sent a 6-digit code to {email}
|
|
846
846
|
</Text>
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
847
|
+
{isTestMode && (
|
|
848
|
+
<Text style={styles.developmentNote}>
|
|
849
|
+
๐ Test Mode: Any 6-digit code will work
|
|
850
|
+
</Text>
|
|
851
|
+
)}
|
|
850
852
|
</View>
|
|
851
853
|
|
|
852
854
|
<View style={styles.emailInputSection}>
|
|
@@ -654,15 +654,17 @@ export const updateGoogleClientIds = (config: {
|
|
|
654
654
|
* ๐ง EMAIL VERIFICATION FUNCTIONS
|
|
655
655
|
* Using the correct Onairos email verification endpoints
|
|
656
656
|
*/
|
|
657
|
-
export const requestEmailVerification = async (email: string): Promise<{
|
|
657
|
+
export const requestEmailVerification = async (email: string, testMode = false): Promise<{
|
|
658
658
|
success: boolean;
|
|
659
659
|
message?: string;
|
|
660
660
|
error?: string;
|
|
661
661
|
}> => {
|
|
662
662
|
try {
|
|
663
663
|
console.log('๐ง Requesting email verification for:', email);
|
|
664
|
+
console.log('๐ Test mode:', testMode);
|
|
664
665
|
|
|
665
|
-
|
|
666
|
+
// Use the correct endpoint: /email/verify
|
|
667
|
+
const response = await fetch('https://api2.onairos.uk/email/verify', {
|
|
666
668
|
method: 'POST',
|
|
667
669
|
headers: {
|
|
668
670
|
'Content-Type': 'application/json',
|
|
@@ -674,10 +676,14 @@ export const requestEmailVerification = async (email: string): Promise<{
|
|
|
674
676
|
|
|
675
677
|
if (response.ok && result.success) {
|
|
676
678
|
console.log('โ
Email verification requested successfully');
|
|
677
|
-
|
|
679
|
+
|
|
680
|
+
const message = testMode
|
|
681
|
+
? 'Verification code sent to your email (testing mode: any code accepted)'
|
|
682
|
+
: result.message || 'Verification code sent to your email';
|
|
683
|
+
|
|
678
684
|
return {
|
|
679
685
|
success: true,
|
|
680
|
-
message
|
|
686
|
+
message,
|
|
681
687
|
};
|
|
682
688
|
} else {
|
|
683
689
|
console.error('โ Email verification request failed:', result.error);
|
|
@@ -695,49 +701,72 @@ export const requestEmailVerification = async (email: string): Promise<{
|
|
|
695
701
|
}
|
|
696
702
|
};
|
|
697
703
|
|
|
698
|
-
export const verifyEmailCode = async (email: string, code: string): Promise<{
|
|
704
|
+
export const verifyEmailCode = async (email: string, code: string, testMode = false): Promise<{
|
|
699
705
|
success: boolean;
|
|
700
706
|
message?: string;
|
|
701
707
|
error?: string;
|
|
708
|
+
existingUser?: boolean;
|
|
702
709
|
}> => {
|
|
703
710
|
try {
|
|
704
711
|
console.log('๐ Verifying email code for:', email);
|
|
705
|
-
console.log('๐
|
|
712
|
+
console.log('๐ Test mode:', testMode);
|
|
713
|
+
|
|
714
|
+
// In test mode, accept any code
|
|
715
|
+
if (testMode) {
|
|
716
|
+
console.log('๐งช Test mode: All codes will pass through');
|
|
717
|
+
// Simulate 30% chance of existing user in test mode
|
|
718
|
+
const simulateExistingUser = Math.random() < 0.3;
|
|
719
|
+
return {
|
|
720
|
+
success: true,
|
|
721
|
+
message: 'Email verified successfully (test mode: all codes accepted)',
|
|
722
|
+
existingUser: simulateExistingUser,
|
|
723
|
+
};
|
|
724
|
+
}
|
|
706
725
|
|
|
707
|
-
//
|
|
708
|
-
// Still make the API call to set up the routing, but don't rely on response
|
|
726
|
+
// Production mode: Make real API call with proper validation
|
|
709
727
|
try {
|
|
710
|
-
const response = await fetch('https://api2.onairos.uk/email/
|
|
728
|
+
const response = await fetch('https://api2.onairos.uk/email/verify', {
|
|
711
729
|
method: 'POST',
|
|
712
730
|
headers: {
|
|
713
731
|
'Content-Type': 'application/json',
|
|
714
732
|
},
|
|
715
|
-
body: JSON.stringify({ email, code
|
|
733
|
+
body: JSON.stringify({ email, code }),
|
|
716
734
|
});
|
|
717
735
|
|
|
718
736
|
const result = await response.json();
|
|
719
737
|
console.log('๐ก Email verification API response:', result);
|
|
738
|
+
|
|
739
|
+
if (response.ok && result.success) {
|
|
740
|
+
console.log('โ
Email verification successful');
|
|
741
|
+
return {
|
|
742
|
+
success: true,
|
|
743
|
+
message: result.message || 'Email verified successfully',
|
|
744
|
+
existingUser: result.existingUser || false, // Backend should return this flag
|
|
745
|
+
};
|
|
746
|
+
} else {
|
|
747
|
+
console.error('โ Email verification failed:', result.error);
|
|
748
|
+
return {
|
|
749
|
+
success: false,
|
|
750
|
+
error: result.error || 'Invalid verification code',
|
|
751
|
+
};
|
|
752
|
+
}
|
|
720
753
|
} catch (apiError) {
|
|
721
|
-
console.
|
|
754
|
+
console.error('โ Email verification API call failed:', apiError);
|
|
755
|
+
return {
|
|
756
|
+
success: false,
|
|
757
|
+
error: 'Network error during verification',
|
|
758
|
+
};
|
|
722
759
|
}
|
|
723
|
-
|
|
724
|
-
// Always return success for now
|
|
725
|
-
console.log('โ
Email verification successful (bypass mode)');
|
|
726
|
-
return {
|
|
727
|
-
success: true,
|
|
728
|
-
message: 'Email verified successfully (development mode: all codes accepted)',
|
|
729
|
-
};
|
|
730
760
|
} catch (error) {
|
|
731
761
|
console.error('โ Email verification error:', error);
|
|
732
|
-
// Even on error, return success for now
|
|
733
762
|
return {
|
|
734
|
-
success:
|
|
735
|
-
|
|
763
|
+
success: false,
|
|
764
|
+
error: error instanceof Error ? error.message : 'Unknown error',
|
|
736
765
|
};
|
|
737
766
|
}
|
|
738
767
|
};
|
|
739
768
|
|
|
740
|
-
export const checkEmailVerificationStatus = async (email: string): Promise<{
|
|
769
|
+
export const checkEmailVerificationStatus = async (email: string, testMode = false): Promise<{
|
|
741
770
|
success: boolean;
|
|
742
771
|
isPending?: boolean;
|
|
743
772
|
message?: string;
|
|
@@ -745,11 +774,21 @@ export const checkEmailVerificationStatus = async (email: string): Promise<{
|
|
|
745
774
|
}> => {
|
|
746
775
|
try {
|
|
747
776
|
console.log('๐ Checking email verification status for:', email);
|
|
748
|
-
console.log('๐
|
|
777
|
+
console.log('๐ Test mode:', testMode);
|
|
778
|
+
|
|
779
|
+
// In test mode, always return no pending verification
|
|
780
|
+
if (testMode) {
|
|
781
|
+
console.log('๐งช Test mode: Always returning no pending verification');
|
|
782
|
+
return {
|
|
783
|
+
success: true,
|
|
784
|
+
isPending: false,
|
|
785
|
+
message: 'Status retrieved successfully (test mode)',
|
|
786
|
+
};
|
|
787
|
+
}
|
|
749
788
|
|
|
750
|
-
// Make API call
|
|
789
|
+
// Production mode: Make real API call
|
|
751
790
|
try {
|
|
752
|
-
const response = await fetch(`https://api2.onairos.uk/email/
|
|
791
|
+
const response = await fetch(`https://api2.onairos.uk/email/verify/status/${encodeURIComponent(email)}`, {
|
|
753
792
|
method: 'GET',
|
|
754
793
|
headers: {
|
|
755
794
|
'Content-Type': 'application/json',
|
|
@@ -758,24 +797,33 @@ export const checkEmailVerificationStatus = async (email: string): Promise<{
|
|
|
758
797
|
|
|
759
798
|
const result = await response.json();
|
|
760
799
|
console.log('๐ก Email verification status API response:', result);
|
|
800
|
+
|
|
801
|
+
if (response.ok && result.success) {
|
|
802
|
+
console.log('โ
Email verification status retrieved');
|
|
803
|
+
return {
|
|
804
|
+
success: true,
|
|
805
|
+
isPending: result.isPending || false,
|
|
806
|
+
message: result.message || 'Status retrieved successfully',
|
|
807
|
+
};
|
|
808
|
+
} else {
|
|
809
|
+
console.error('โ Email verification status failed:', result.error);
|
|
810
|
+
return {
|
|
811
|
+
success: false,
|
|
812
|
+
error: result.error || 'Failed to check verification status',
|
|
813
|
+
};
|
|
814
|
+
}
|
|
761
815
|
} catch (apiError) {
|
|
762
|
-
console.
|
|
816
|
+
console.error('โ Email verification status API call failed:', apiError);
|
|
817
|
+
return {
|
|
818
|
+
success: false,
|
|
819
|
+
error: 'Network error while checking status',
|
|
820
|
+
};
|
|
763
821
|
}
|
|
764
|
-
|
|
765
|
-
// For development, always return no pending verification
|
|
766
|
-
console.log('โ
Email verification status retrieved (bypass mode)');
|
|
767
|
-
return {
|
|
768
|
-
success: true,
|
|
769
|
-
isPending: false, // Always false so verification flow starts fresh
|
|
770
|
-
message: 'Status retrieved successfully (development mode)',
|
|
771
|
-
};
|
|
772
822
|
} catch (error) {
|
|
773
823
|
console.error('โ Email verification status error:', error);
|
|
774
|
-
// Even on error, return success for development
|
|
775
824
|
return {
|
|
776
|
-
success:
|
|
777
|
-
|
|
778
|
-
message: 'Status retrieved successfully (development mode)',
|
|
825
|
+
success: false,
|
|
826
|
+
error: error instanceof Error ? error.message : 'Unknown error',
|
|
779
827
|
};
|
|
780
828
|
}
|
|
781
829
|
};
|