mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-08-09 19:32:10 +08:00
Add option to use ApiKeys in Twilio in addition to main account credentials
This commit is contained in:
@@ -10,6 +10,7 @@ class Twilio extends NotificationProvider {
|
||||
let okMsg = "Sent Successfully.";
|
||||
|
||||
let accountSID = notification.twilioAccountSID;
|
||||
let apiKey = notification.twilioApiKey ? notification.twilioApiKey : accountSID;
|
||||
let authToken = notification.twilioAuthToken;
|
||||
|
||||
try {
|
||||
@@ -17,7 +18,7 @@ class Twilio extends NotificationProvider {
|
||||
let config = {
|
||||
headers: {
|
||||
"Content-Type": "application/x-www-form-urlencoded;charset=utf-8",
|
||||
"Authorization": "Basic " + Buffer.from(accountSID + ":" + authToken).toString("base64"),
|
||||
"Authorization": "Basic " + Buffer.from(apiKey + ":" + authToken).toString("base64"),
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user