Merge branch 'fix/webapp-signin-ssr-window' into deploy/enterprise

This commit is contained in:
GareArc 2026-06-11 01:36:05 -07:00
commit 7e4b1cadd8
No known key found for this signature in database

View File

@ -55,7 +55,8 @@ export const useWebAppStore = create<WebAppStore>(set => ({
const getShareCodeFromRedirectUrl = (redirectUrl: string | null): string | null => {
if (!redirectUrl || redirectUrl.length === 0)
return null
const url = new URL(`${window.location.origin}${decodeURIComponent(redirectUrl)}`)
// base only anchors relative-path parsing; never read back (SSR-safe)
const url = new URL(decodeURIComponent(redirectUrl), 'http://base.invalid')
return url.pathname.split('/').pop() || null
}
const getShareCodeFromPathname = (pathname: string): string | null => {