Skip to content

Commit 276ecba

Browse files
authored
Merge pull request #21 from Apillon/fix/claim-link
Fixed claim link generation
2 parents 3890faa + d5974c9 commit 276ecba

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)