summary refs log tree commit diff
path: root/src/util
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-12-17 10:18:17 +0100
committerRory& <root@rory.gay>2025-12-17 10:18:17 +0100
commite008c9947e9b8e4191e3cc4026d2b49ae784e252 (patch)
tree29fd0d0579773915c4d8b59c7cb3bd582ba1fba8 /src/util
parentRemove GATEWAY/CDN env variables in favor of single source of truth (diff)
downloadserver-ts-e008c9947e9b8e4191e3cc4026d2b49ae784e252.tar.xz
No more fallback URLs
Diffstat (limited to 'src/util')
-rw-r--r--src/util/connections/Connection.ts3
-rw-r--r--src/util/util/cdn.ts4
-rw-r--r--src/util/util/email/index.ts2
3 files changed, 4 insertions, 5 deletions
diff --git a/src/util/connections/Connection.ts b/src/util/connections/Connection.ts

index bfe2d764..7eb8bdd7 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 398e747d..115fcb4b 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 4773b0db..729d5dd0 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;