From b90da88341029b98ecb70c64054a3781f5db2670 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Fri, 28 Nov 2025 23:06:38 +0100 Subject: [PATCH] fix: Magic link url incorrect for custom domains (#10746) --- server/emails/templates/SigninEmail.tsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/server/emails/templates/SigninEmail.tsx b/server/emails/templates/SigninEmail.tsx index a42721a368..b91884096e 100644 --- a/server/emails/templates/SigninEmail.tsx +++ b/server/emails/templates/SigninEmail.tsx @@ -43,7 +43,7 @@ export default class SigninEmail extends BaseEmail { return ` Use the link below to sign in: -${this.signinLink(token, client)} +${this.signinLink(teamUrl, token, client)} If the link expired you can request a new one from your team's signin page at: ${teamUrl} @@ -63,7 +63,7 @@ signin page at: ${teamUrl} if (token) { logger.debug( "email", - `Sign-In link: ${this.signinLink(token, client)}` + `Sign-In link: ${this.signinLink(teamUrl, token, client)}` ); } if (verificationCode) { @@ -76,7 +76,7 @@ signin page at: ${teamUrl} previewText={this.preview()} goToAction={ token - ? { url: this.signinLink(token, client), name: "Sign In" } + ? { url: this.signinLink(teamUrl, token, client), name: "Sign In" } : undefined } > @@ -88,7 +88,9 @@ signin page at: ${teamUrl}

Click the button below to sign in to {env.APP_NAME}.

- +

@@ -125,7 +127,7 @@ signin page at: ${teamUrl} ); } - private signinLink(token: string, client: Client): string { - return `${env.URL}/auth/email.callback?token=${token}&client=${client}`; + private signinLink(teamUrl: string, token: string, client: Client): string { + return `${teamUrl}/auth/email.callback?token=${token}&client=${client}`; } }