mirror of
https://github.com/spacebarchat/server.git
synced 2026-10-23 10:53:01 +00:00
No more fallback URLs
This commit is contained in:
1 parent
0dd12d0380
commit
e008c9947e
6 files changed
+7
-11
No files matched your search
@@ -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`;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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,
|
||||
},
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user