replace twilio connect with account sid/auth token form
This commit is contained in:
@ -51,7 +51,7 @@ export const action: ActionFunction = async ({ request }) => {
|
||||
return new Response(null, { status: 402 });
|
||||
}
|
||||
|
||||
const encryptedAuthToken = phoneNumber?.organization.twilioAccount?.subAccountAuthToken;
|
||||
const encryptedAuthToken = phoneNumber?.organization.twilioAccount?.authToken;
|
||||
const authToken = encryptedAuthToken ? decrypt(encryptedAuthToken) : "";
|
||||
if (
|
||||
!phoneNumber ||
|
||||
|
@ -57,7 +57,7 @@ export const action: ActionFunction = async ({ request }) => {
|
||||
// if multiple organizations have the same number
|
||||
// find the organization currently using that phone number
|
||||
// maybe we shouldn't let that happen by restricting a phone number to one org?
|
||||
const encryptedAuthToken = phoneNumber.organization.twilioAccount?.subAccountAuthToken;
|
||||
const encryptedAuthToken = phoneNumber.organization.twilioAccount?.authToken;
|
||||
const authToken = encryptedAuthToken ? decrypt(encryptedAuthToken) : "";
|
||||
return twilio.validateRequest(authToken, twilioSignature, smsUrl, body);
|
||||
});
|
||||
|
Reference in New Issue
Block a user