Skip to content

Commit 302c93e

Browse files
committed
created a test account to bypass otp, will revert after verification
1 parent b7aaf00 commit 302c93e

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/services/twilioService.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@ if (!accountSid || !authToken || !verifyServiceSid || !twilioWhatsappNumber) {
1212
const client = twilio(accountSid, authToken);
1313

1414
export const sendOTP = async (phone: string) => {
15+
// Hardcoded test account for App Store verification
16+
const TEST_PHONE = '+917387424149';
17+
18+
// Skip sending OTP for test account
19+
if (phone === TEST_PHONE) {
20+
console.log('[twilioService.sendOTP] Test account - skipping OTP send:', phone);
21+
return 'pending'; // Return same status as Twilio would
22+
}
23+
24+
// Normal Twilio OTP sending for other users
1525
const verification = await client.verify.v2
1626
.services(verifyServiceSid)
1727
.verifications.create({ to: phone, channel: 'sms' });
@@ -20,6 +30,17 @@ export const sendOTP = async (phone: string) => {
2030
};
2131

2232
export const verifyOTP = async (phone: string, code: string) => {
33+
// Hardcoded test account for App Store verification
34+
const TEST_PHONE = '+917387424149';
35+
const TEST_OTP = '100100';
36+
37+
// Check if this is the test account
38+
if (phone === TEST_PHONE && code === TEST_OTP) {
39+
console.log('[twilioService.verifyOTP] Test account verified:', phone);
40+
return true;
41+
}
42+
43+
// Normal Twilio verification for other users
2344
const verificationCheck = await client.verify.v2
2445
.services(verifyServiceSid)
2546
.verificationChecks.create({ to: phone, code });

0 commit comments

Comments
 (0)