Fix redirect logic - Discord OAuth logins always go to dashboard
cgen-c0ed43cb66464c13a8e880eaf03ac566
This commit is contained in:
parent
d213425173
commit
a00aca6851
1 changed files with 2 additions and 7 deletions
|
|
@ -292,13 +292,8 @@ export default async function handler(req: any, res: any) {
|
||||||
|
|
||||||
res.setHeader("Set-Cookie", [accessTokenCookie, refreshTokenCookie]);
|
res.setHeader("Set-Cookie", [accessTokenCookie, refreshTokenCookie]);
|
||||||
|
|
||||||
// Redirect to next page
|
// Redirect to dashboard (we only log in existing users here)
|
||||||
const nextPath =
|
const nextPath = "/dashboard";
|
||||||
state && typeof state === "string" && state.startsWith("/")
|
|
||||||
? state
|
|
||||||
: isNewUser
|
|
||||||
? "/onboarding"
|
|
||||||
: "/dashboard";
|
|
||||||
|
|
||||||
// Determine the base URL from environment or request origin
|
// Determine the base URL from environment or request origin
|
||||||
let baseUrl = process.env.VITE_API_BASE || process.env.API_BASE;
|
let baseUrl = process.env.VITE_API_BASE || process.env.API_BASE;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue