mirror of
https://github.com/eigent-ai/eigent.git
synced 2026-04-28 19:50:34 +00:00
Initial commit of eigent-main
This commit is contained in:
commit
723df5a03e
1144 changed files with 103478 additions and 0 deletions
21
package/@stackframe/react/dist/esm/utils/url.js
vendored
Normal file
21
package/@stackframe/react/dist/esm/utils/url.js
vendored
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue