Initial commit of eigent-main

This commit is contained in:
puzhen 2025-08-12 01:16:39 +02:00
commit 723df5a03e
1144 changed files with 103478 additions and 0 deletions

View file

@ -0,0 +1,21 @@
// src/utils/url.ts
import { StackAssertionError } from "@stackframe/stack-shared/dist/utils/errors";
function constructRedirectUrl(redirectUrl, callbackUrlName) {
if (typeof window === "undefined" || !window.location) {
throw new StackAssertionError(`${callbackUrlName} option is required in a non-browser environment.`, { redirectUrl });
}
const retainedQueryParams = ["after_auth_return_to"];
const currentUrl = new URL(window.location.href);
const url = redirectUrl ? new URL(redirectUrl, window.location.href) : new URL(window.location.href);
for (const param of retainedQueryParams) {
if (currentUrl.searchParams.has(param)) {
url.searchParams.set(param, currentUrl.searchParams.get(param));
}
}
url.hash = "";
return url.toString();
}
export {
constructRedirectUrl
};
//# sourceMappingURL=url.js.map