From 1e30d349f5a65aa43fabea4dc66b99b00bcbeee0 Mon Sep 17 00:00:00 2001 From: Hammer Date: Wed, 28 Jan 2026 21:44:09 +0000 Subject: [PATCH] fix: use frontend URL for reset/invite links instead of API URL --- src/routes/admin.ts | 8 ++++---- src/routes/password-reset.ts | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/routes/admin.ts b/src/routes/admin.ts index 536e216..bbc5e89 100644 --- a/src/routes/admin.ts +++ b/src/routes/admin.ts @@ -95,8 +95,8 @@ export const adminRoutes = new Elysia({ prefix: '/admin' }) expiresAt, }).returning(); - const appUrl = process.env.APP_URL || 'https://thenetwork.donovankelly.xyz'; - const setupUrl = `${appUrl}/invite/${token}`; + const frontendUrl = process.env.FRONTEND_URL || process.env.ALLOWED_ORIGINS?.split(',')[0] || 'https://app.thenetwork.donovankelly.xyz'; + const setupUrl = `${frontendUrl}/invite/${token}`; return { ...invite, setupUrl }; }, { @@ -140,8 +140,8 @@ export const adminRoutes = new Elysia({ prefix: '/admin' }) expiresAt, }); - const appUrl = process.env.APP_URL || 'https://thenetwork.donovankelly.xyz'; - const resetUrl = `${appUrl}/reset-password/${token}`; + const frontendUrl = process.env.FRONTEND_URL || process.env.ALLOWED_ORIGINS?.split(',')[0] || 'https://app.thenetwork.donovankelly.xyz'; + const resetUrl = `${frontendUrl}/reset-password/${token}`; return { resetUrl, email: targetUser.email }; }, { diff --git a/src/routes/password-reset.ts b/src/routes/password-reset.ts index 914e91c..29f7da9 100644 --- a/src/routes/password-reset.ts +++ b/src/routes/password-reset.ts @@ -36,8 +36,8 @@ export const passwordResetRoutes = new Elysia({ prefix: '/auth/reset-password' } expiresAt, }); - const appUrl = process.env.APP_URL || 'https://thenetwork.donovankelly.xyz'; - const resetUrl = `${appUrl}/reset-password/${token}`; + const frontendUrl = process.env.FRONTEND_URL || process.env.ALLOWED_ORIGINS?.split(',')[0] || 'https://app.thenetwork.donovankelly.xyz'; + const resetUrl = `${frontendUrl}/reset-password/${token}`; // For now, return the URL in the response (no email sending yet) return {