Skip to content

Commit d5974c9

Browse files
committed
Fixed claim link generation
1 parent 3890faa commit d5974c9

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

backend/src/lib/claim.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ export function validateAirdropStatus(airdropStatus: AirdropStatus) {
7272

7373
export function parseUrl(token: string) {
7474
const appUrl = new URL(env.APP_URL);
75+
const basePath = appUrl.pathname.replace(/\/$/, ''); // Remove trailing slash if present
76+
appUrl.pathname = `${basePath}/claim`; // Append '/claim' to the path
7577
appUrl.searchParams.set('nftToken', token);
7678

77-
return `${appUrl.origin}/claim?${appUrl.searchParams.toString()}`;
79+
return appUrl.toString(); // Return the full URL as a string
7880
}

0 commit comments

Comments
 (0)