Skip to content

Commit 22f704d

Browse files
authored
Merge pull request #2988 from Harikrishnan1367709/Invitation-Link-broken-on-Mac-#2986
fix: Add protocol prefix to invitation links (#2986)
2 parents fd8f0e8 + b202974 commit 22f704d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

apps/dokploy/server/api/routers/user.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
findNotificationById,
55
findOrganizationById,
66
findUserById,
7+
getDokployUrl,
78
getUserByToken,
89
IS_CLOUD,
910
removeUserById,
@@ -419,11 +420,10 @@ export const userRouter = createTRPCRouter({
419420
});
420421
}
421422

422-
const admin = await findAdmin();
423423
const host =
424424
process.env.NODE_ENV === "development"
425425
? "http://localhost:3000"
426-
: admin.user.host;
426+
: await getDokployUrl();
427427
const inviteLink = `${host}/invitation?token=${input.invitationId}`;
428428

429429
const organization = await findOrganizationById(

packages/server/src/services/admin.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ export const getDokployUrl = async () => {
110110
const admin = await findAdmin();
111111

112112
if (admin.user.host) {
113-
return `https://${admin.user.host}`;
113+
const protocol = admin.user.https ? "https" : "http";
114+
return `${protocol}://${admin.user.host}`;
114115
}
115116
return `http://${admin.user.serverIp}:${process.env.PORT}`;
116117
};

0 commit comments

Comments
 (0)