mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-22 18:25:47 +08:00
feat: fix provider test API's missing owner and name args for auth (#3676)
This commit is contained in:
parent
a11fe59704
commit
14ade8b7e4
@ -51,6 +51,8 @@ function testEmailProvider(provider, email = "") {
|
||||
receivers: email === "" ? ["TestSmtpServer"] : [email],
|
||||
provider: provider.name,
|
||||
providerObject: provider,
|
||||
owner: provider.owner,
|
||||
name: provider.name,
|
||||
};
|
||||
|
||||
return fetch(`${Setting.ServerUrl}/api/send-email`, {
|
||||
|
@ -16,7 +16,7 @@ import * as Setting from "../Setting";
|
||||
import i18next from "i18next";
|
||||
|
||||
export function sendTestNotification(provider) {
|
||||
testNotificationProvider(provider.content, provider.name)
|
||||
testNotificationProvider(provider)
|
||||
.then((res) => {
|
||||
if (res.status === "ok") {
|
||||
Setting.showMessage("success", i18next.t("general:Successfully sent"));
|
||||
@ -29,12 +29,14 @@ export function sendTestNotification(provider) {
|
||||
});
|
||||
}
|
||||
|
||||
function testNotificationProvider(content, name) {
|
||||
function testNotificationProvider(provider) {
|
||||
const notificationForm = {
|
||||
content: content,
|
||||
content: provider.content,
|
||||
owner: provider.owner,
|
||||
name: provider.name,
|
||||
};
|
||||
|
||||
return fetch(`${Setting.ServerUrl}/api/send-notification?provider=${name}`, {
|
||||
return fetch(`${Setting.ServerUrl}/api/send-notification?provider=${provider.name}`, {
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(notificationForm),
|
||||
|
@ -33,6 +33,8 @@ function testSmsProvider(provider, phone = "") {
|
||||
const SmsForm = {
|
||||
content: "123456",
|
||||
receivers: [phone],
|
||||
owner: provider.owner,
|
||||
name: provider.name,
|
||||
};
|
||||
|
||||
return fetch(`${Setting.ServerUrl}/api/send-sms?provider=` + provider.name, {
|
||||
|
Loading…
x
Reference in New Issue
Block a user