diff --git a/src/api/routes/channels/#channel_id/webhooks.ts b/src/api/routes/channels/#channel_id/webhooks.ts
index 106d8442c..9d226b19a 100644
--- a/src/api/routes/channels/#channel_id/webhooks.ts
+++ b/src/api/routes/channels/#channel_id/webhooks.ts
@@ -43,11 +43,10 @@ router.get(
relations: ["user", "channel", "source_channel", "guild", "source_guild", "application"],
});
- const instanceUrl = Config.get().api.endpointPublic || "http://localhost:3001";
return res.json(
webhooks.map((webhook) => ({
...webhook,
- url: instanceUrl + "/webhooks/" + webhook.id + "/" + webhook.token,
+ url: Config.get().api.endpointPublic + "/webhooks/" + webhook.id + "/" + webhook.token,
})),
);
},
diff --git a/src/api/routes/webhooks/#webhook_id/#token/index.ts b/src/api/routes/webhooks/#webhook_id/#token/index.ts
index 18902ac00..1b589a7bb 100644
--- a/src/api/routes/webhooks/#webhook_id/#token/index.ts
+++ b/src/api/routes/webhooks/#webhook_id/#token/index.ts
@@ -35,10 +35,9 @@ router.get(
throw DiscordApiErrors.INVALID_WEBHOOK_TOKEN_PROVIDED;
}
- const instanceUrl = Config.get().api.endpointPublic || "http://localhost:3001";
return res.json({
...webhook,
- url: instanceUrl + "/webhooks/" + webhook.id + "/" + webhook.token,
+ url: Config.get().api.endpointPublic + "/webhooks/" + webhook.id + "/" + webhook.token,
});
},
);
diff --git a/src/api/routes/webhooks/#webhook_id/index.ts b/src/api/routes/webhooks/#webhook_id/index.ts
index 3a0dfe534..9c0a6418d 100644
--- a/src/api/routes/webhooks/#webhook_id/index.ts
+++ b/src/api/routes/webhooks/#webhook_id/index.ts
@@ -29,10 +29,9 @@ router.get(
if (!permission.has("MANAGE_WEBHOOKS")) throw DiscordApiErrors.UNKNOWN_WEBHOOK;
} else if (webhook.user_id != req.user_id) throw DiscordApiErrors.UNKNOWN_WEBHOOK;
- const instanceUrl = Config.get().api.endpointPublic || "http://localhost:3001";
return res.json({
...webhook,
- url: instanceUrl + "/webhooks/" + webhook.id + "/" + webhook.token,
+ url: Config.get().api.endpointPublic + "/webhooks/" + webhook.id + "/" + webhook.token,
});
},
);
diff --git a/src/util/connections/Connection.ts b/src/util/connections/Connection.ts
index bfe2d7649..7eb8bdd7c 100644
--- a/src/util/connections/Connection.ts
+++ b/src/util/connections/Connection.ts
@@ -42,8 +42,7 @@ export abstract class Connection {
* @returns redirect_uri for this connection
*/
getRedirectUri() {
- const endpointPublic = Config.get().general.frontPage ?? "http://localhost:3001";
- return `${endpointPublic}/connections/${this.id}/callback`;
+ return `${Config.get().general.frontPage}/connections/${this.id}/callback`;
}
/**
diff --git a/src/util/util/cdn.ts b/src/util/util/cdn.ts
index 398e747d6..115fcb4b8 100644
--- a/src/util/util/cdn.ts
+++ b/src/util/util/cdn.ts
@@ -34,7 +34,7 @@ export async function uploadFile(
filename: file.originalname,
});
- const response = await fetch(`${Config.get().cdn.endpointPrivate || "http://localhost:3001"}${path}`, {
+ const response = await fetch(`${Config.get().cdn.endpointPrivate}${path}`, {
headers: {
signature: Config.get().security.requestSignature,
...form.getHeaders(),
@@ -67,7 +67,7 @@ export async function handleFile(path: string, body?: string): Promise<string |
}
export async function deleteFile(path: string) {
- const response = await fetch(`${Config.get().cdn.endpointPrivate || "http://localhost:3001"}${path}`, {
+ const response = await fetch(`${Config.get().cdn.endpointPrivate}${path}`, {
headers: {
signature: Config.get().security.requestSignature,
},
diff --git a/src/util/util/email/index.ts b/src/util/util/email/index.ts
index 4773b0db2..729d5dd01 100644
--- a/src/util/util/email/index.ts
+++ b/src/util/util/email/index.ts
@@ -130,7 +130,7 @@ export const Email: {
generateLink: async function (type, id) {
const token = (await generateToken(id)) as string;
// puyodead1: this is set to api endpoint because the verification page is on the server since no clients have one, and not all 3rd party clients will have one
- const instanceUrl = Config.get().api.endpointPublic?.replace("/api", "") || "http://localhost:3001";
+ const instanceUrl = Config.get().api.endpointPublic?.replace("/api", "");
const dashedType = type.replace(/([A-Z])/g, "-$1").toLowerCase();
const link = `${instanceUrl}/${dashedType}#token=${token}`;
return link;
|