Skip to content

Commit

Permalink
BC-7171 - Fix redirect URL construction to handle query parameters co…
Browse files Browse the repository at this point in the history
…rrectly
  • Loading branch information
bergatco committed Dec 19, 2024
1 parent 20758f8 commit 63439df
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils/redirectUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ const getParentId = () => {
const redirectToLoginPage = async () => {
const envs = await getEnvs();
const parentId = getParentId();
const redirectUrl =
envs.NOT_AUTHENTICATED_REDIRECT_URL +
`&redirect=/tldraw?parentId=${parentId}`;
let redirectUrl = envs.NOT_AUTHENTICATED_REDIRECT_URL;
const separator = redirectUrl.includes("?") ? "&" : "?";
redirectUrl += `${separator}redirect=/tldraw?parentId=${parentId}`;
window.location.assign(redirectUrl);
};

Expand Down

0 comments on commit 63439df

Please sign in to comment.