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 {