completionId: cgen-21745690667748c29d0660b939ea696f

cgen-21745690667748c29d0660b939ea696f
This commit is contained in:
Builder.io 2025-11-11 06:34:07 +00:00
parent 779a5bffe7
commit 3b07eec781

View file

@ -768,6 +768,12 @@ export function createServer() {
}
const redirectUri = `${apiBase}/api/discord/oauth/callback`;
console.log(
"[Discord OAuth Start] Using redirect URI:",
redirectUri,
"from API base:",
apiBase,
);
// Get the state from query params (can be a JSON string with action and redirectTo)
let state = req.query.state || "/dashboard";
@ -784,6 +790,7 @@ export function createServer() {
});
const discordOAuthUrl = `https://discord.com/api/oauth2/authorize?${params.toString()}`;
console.log("[Discord OAuth Start] Redirecting to:", discordOAuthUrl);
return res.redirect(302, discordOAuthUrl);
} catch (e: any) {
return res.status(500).json({ error: e?.message || String(e) });