fix: use frontend URL for reset/invite links instead of API URL

This commit is contained in:
2026-01-28 21:44:09 +00:00
parent 6b075b9ab5
commit 1e30d349f5
2 changed files with 6 additions and 6 deletions

View File

@@ -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 };
}, {

View File

@@ -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 {