AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
fix(frontend): Use `FRONTEND_BASE_URL` to make password reset link (#10102)
Reinier van der Leer96df40f7b607
diff --git a/autogpt_platform/frontend/.env.example b/autogpt_platform/frontend/.env.exampleindex 675d0ab1fc..04e3831b6c 100644--- a/autogpt_platform/frontend/.env.example+++ b/autogpt_platform/frontend/.env.example@@ -1,3 +1,5 @@+FRONTEND_BASE_URL=http://localhost:3000+NEXT_PUBLIC_AUTH_CALLBACK_URL=http://localhost:8006/auth/callbackNEXT_PUBLIC_AGPT_SERVER_URL=http://localhost:8006/apiNEXT_PUBLIC_AGPT_WS_SERVER_URL=ws://localhost:8001/ws@@ -19,7 +21,7 @@ NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAic## OAuth Callback URL## This should be {domain}/auth/callback## Only used if you're using Supabase and OAuth-AUTH_CALLBACK_URL=http://localhost:3000/auth/callback+AUTH_CALLBACK_URL="${FRONTEND_BASE_URL}/auth/callback"GA_MEASUREMENT_ID=G-FH2XK2W4GN# When running locally, set NEXT_PUBLIC_BEHAVE_AS=CLOUD to use the a locally hosted marketplace (as is typical in development, and the cloud deployment), otherwise set it to LOCAL to have the marketplace open in a new tabdiff --git a/autogpt_platform/frontend/src/app/(platform)/reset_password/actions.ts b/autogpt_platform/frontend/src/app/(platform)/reset_password/actions.tsindex f3874ca76f..6760e911be 100644--- a/autogpt_platform/frontend/src/app/(platform)/reset_password/actions.ts+++ b/autogpt_platform/frontend/src/app/(platform)/reset_password/actions.ts@@ -2,7 +2,6 @@import getServerSupabase from "@/lib/supabase/getServerSupabase";import { redirect } from "next/navigation";import * as Sentry from "@sentry/nextjs";-import { headers } from "next/headers";import { verifyTurnstileToken } from "@/lib/turnstile";export async function sendResetEmail(email: string, turnstileToken: string) {@@ -11,11 +10,7 @@ export async function sendResetEmail(email: string, turnstileToken: string) {{},async () => {const supabase = getServerSupabase();- const headersList = await headers();- const host = headersList.get("host");- const protocol =- process.env.NODE_ENV === "development" ? "http" : "https";- const origin = `${protocol}://${host}`;+ const origin = process.env.FRONTEND_BASE_URL || "http://localhost:3000";if (!supabase) {redirect("/error");