fix: resolve issue where discourse redirects dont work

This commit is contained in:
mrjvs
2026-10-25 11:57:46 +01:00
parent 94bfd522df
commit c6a3d0da52

View File

@@ -16,8 +16,9 @@ export function getSafeRedirectUrl(input: string | null, baseUrl: string, allowe
return null; // Not in the allowed hosts
}
// If on the same host as the website, only return the path. For internal redirects
if (url.host === parsedBaseUrl.host) {
// If on the same host as the website, only return the path. For internal redirects (cuz they load faster)
// Exception: SSO urls are routes and not pages, cant be an internal redirect
if (url.host === parsedBaseUrl.host && !url.pathname.includes('sso')) {
return {
url: url.pathname + url.search,
external: false