mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 02:35:49 +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],
|
receivers: email === "" ? ["TestSmtpServer"] : [email],
|
||||||
provider: provider.name,
|
provider: provider.name,
|
||||||
providerObject: provider,
|
providerObject: provider,
|
||||||
|
owner: provider.owner,
|
||||||
|
name: provider.name,
|
||||||
};
|
};
|
||||||
|
|
||||||
return fetch(`${Setting.ServerUrl}/api/send-email`, {
|
return fetch(`${Setting.ServerUrl}/api/send-email`, {
|
||||||
|
@ -16,7 +16,7 @@ import * as Setting from "../Setting";
|
|||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
|
|
||||||
export function sendTestNotification(provider) {
|
export function sendTestNotification(provider) {
|
||||||
testNotificationProvider(provider.content, provider.name)
|
testNotificationProvider(provider)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.status === "ok") {
|
if (res.status === "ok") {
|
||||||
Setting.showMessage("success", i18next.t("general:Successfully sent"));
|
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 = {
|
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",
|
method: "POST",
|
||||||
credentials: "include",
|
credentials: "include",
|
||||||
body: JSON.stringify(notificationForm),
|
body: JSON.stringify(notificationForm),
|
||||||
|
@ -33,6 +33,8 @@ function testSmsProvider(provider, phone = "") {
|
|||||||
const SmsForm = {
|
const SmsForm = {
|
||||||
content: "123456",
|
content: "123456",
|
||||||
receivers: [phone],
|
receivers: [phone],
|
||||||
|
owner: provider.owner,
|
||||||
|
name: provider.name,
|
||||||
};
|
};
|
||||||
|
|
||||||
return fetch(`${Setting.ServerUrl}/api/send-sms?provider=` + provider.name, {
|
return fetch(`${Setting.ServerUrl}/api/send-sms?provider=` + provider.name, {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user