Fix redirect logic - Discord OAuth logins always go to dashboard

cgen-c0ed43cb66464c13a8e880eaf03ac566
This commit is contained in:
Builder.io 2025-11-10 22:19:13 +00:00
parent d213425173
commit a00aca6851

View file

@ -292,13 +292,8 @@ export default async function handler(req: any, res: any) {
res.setHeader("Set-Cookie", [accessTokenCookie, refreshTokenCookie]);
// Redirect to next page
const nextPath =
state && typeof state === "string" && state.startsWith("/")
? state
: isNewUser
? "/onboarding"
: "/dashboard";
// Redirect to dashboard (we only log in existing users here)
const nextPath = "/dashboard";
// Determine the base URL from environment or request origin
let baseUrl = process.env.VITE_API_BASE || process.env.API_BASE;