diff --git a/.env.sample b/.env.sample index ac5a3b3..b5c2181 100644 --- a/.env.sample +++ b/.env.sample @@ -1,5 +1,6 @@ DATABASE_URL= SESSION_SECRET= +BASE_URL= ADMIN_EMAIL= diff --git a/app/routes/admin/dashboard.tsx b/app/routes/admin/dashboard.tsx index b9c5b01..491d9f5 100644 --- a/app/routes/admin/dashboard.tsx +++ b/app/routes/admin/dashboard.tsx @@ -73,7 +73,7 @@ export const action: ActionFunction = async ({ request }) => { subject: "Welcome to Fantomely", text: `Welcome to Fantomely! You can now finish your registration using the following link: ${ - new URL(request.url).origin + process.env.BASE_URL }/auth/waitlist/callback?email=${encodeURIComponent( user.email )}&token=${waitlistToken}`, diff --git a/app/routes/app/websites.details.$id.tsx b/app/routes/app/websites.details.$id.tsx index ec07472..deffc2f 100644 --- a/app/routes/app/websites.details.$id.tsx +++ b/app/routes/app/websites.details.$id.tsx @@ -31,7 +31,7 @@ export const loader: LoaderFunction = async ({ params, request }) => { const user = await requireCurrentUser(request); const website = await db.website.findUnique({ where: { id: params.id } }); - return { website, user, origin: new URL(request.url).origin }; + return { website, user, origin: process.env.BASE_URL }; }; export default function WebsiteDetailsRoute() { diff --git a/app/routes/auth/login.tsx b/app/routes/auth/login.tsx index cb6234e..b327590 100644 --- a/app/routes/auth/login.tsx +++ b/app/routes/auth/login.tsx @@ -82,7 +82,7 @@ export const action: ActionFunction = async ({ request }) => { subject: "Log into fantomely", text: `Log into fantomely! Here is your magic link to log into your fantomely account: ${ - new URL(request.url).origin + process.env.BASE_URL }/auth/login/callback?email=${encodeURIComponent(email)}&token=${ magicLink.token }&redirectTo=${redirectTo}`, diff --git a/fly.toml b/fly.toml index 7eb6e47..27586ec 100644 --- a/fly.toml +++ b/fly.toml @@ -8,6 +8,7 @@ processes = [] [env] PORT = "8080" + BASE_URL = "https://fantomely.com" [experimental] allowed_public_ports = []