Skip to content

Commit 16464ba

Browse files
committed
Update OTP auth to use 'method' and 'sms' for phone
Changed the OTP initiation payload to use 'method' instead of 'type', and set phone strategy to 'sms' instead of 'phone'. Also removed the unused return value from sendOtp to match updated API expectations.
1 parent e644c3d commit 16464ba

File tree

1 file changed

+3
-3
lines changed
  • packages/thirdweb/src/wallets/in-app/web/lib/auth

1 file changed

+3
-3
lines changed

packages/thirdweb/src/wallets/in-app/web/lib/auth/otp.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ export const sendOtp = async (args: PreAuthArgsType): Promise<void> => {
3333
switch (args.strategy) {
3434
case "email":
3535
return {
36-
type: "email",
36+
method: "email",
3737
email: args.email,
3838
};
3939
case "phone":
4040
return {
41-
type: "phone",
41+
method: "sms",
4242
phone: args.phoneNumber,
4343
};
4444
}
@@ -54,7 +54,7 @@ export const sendOtp = async (args: PreAuthArgsType): Promise<void> => {
5454
throw new Error("Failed to send verification code");
5555
}
5656

57-
return await response.json();
57+
return;
5858
};
5959

6060
/**

0 commit comments

Comments
 (0)