Skip to content

Commit 7701d0b

Browse files
dahliaclaude
andcommitted
Fix SSR compatibility for invitation verifyUrl
- Replace window.location.origin with globalThis.location?.origin fallback - Prevents SSR errors when window is not available - Provides fallback URL for server-side rendering contexts Co-Authored-By: Claude <[email protected]>
1 parent f103859 commit 7701d0b

File tree

1 file changed

+3
-1
lines changed
  • web-next/src/routes/(root)/[handle]/settings

1 file changed

+3
-1
lines changed

web-next/src/routes/(root)/[handle]/settings/invite.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,9 @@ export default function InvitePage() {
143143
email: email(),
144144
locale: invitationLanguage(),
145145
message: message().trim() === "" ? null : message().trim(),
146-
verifyUrl: `${window.location.origin}/sign/up/{token}?code={code}`,
146+
verifyUrl: `${
147+
globalThis.location?.origin ?? "https://hackers.pub"
148+
}/sign/up/{token}?code={code}`,
147149
},
148150
onCompleted({ invite }) {
149151
setSending(false);

0 commit comments

Comments
 (0)