The weeb for the next gen discord boat - Wamellow wamellow.com
bot discord
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

guild invite redirect state

Luna daa273f2 f710a92e

+11 -4
+11 -4
app/login/route.ts
··· 109 109 } 110 110 111 111 function getRedirectUrl(searchParams: URLSearchParams) { 112 + const redirectUrl = parseRedirectUrlFromState(searchParams.get("state")); 112 113 const guildId = searchParams.get("guild_id"); 113 - if (guildId) return `/dashboard/${guildId}`; 114 + 115 + if (guildId) return `/dashboard/${guildId}${redirectUrl}`; 116 + return redirectUrl; 117 + } 118 + 119 + function parseRedirectUrlFromState(state: string | null) { 120 + if (!state) return "/"; 114 121 115 - const redirectUrl = decodeURIComponent(searchParams.get("state") || "/"); 116 - if (redirectUrl.includes("://")) return "/"; 122 + const path = decodeURIComponent(state); 123 + if (path.includes("://")) return "/"; 117 124 118 - return redirectUrl; 125 + return path || "/"; 119 126 }