Skip to content

Commit

Permalink
add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcarpenter committed Dec 11, 2024
1 parent c8bc88d commit 8888795
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/clerk-js/src/ui/contexts/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ export function getInitialValuesFromQueryParams(queryString: string, params: str
export const populateParamFromObject = createDynamicParamParser({ regex: /:(\w+)/ });

type Mode = 'modal' | 'mounted' | undefined;
/**
* When we're in modal mode and no redirect_url is provided, we want to redirect to the current page after sign-in or sign-up.
*/
export const determineRedirectUrlFromMode = ({ mode, url, clerk }: { mode: Mode; url: string; clerk: Clerk }) => {
return mode === 'modal' && url === '/' ? window.location.href : clerk.buildUrlWithAuth(url);
};

0 comments on commit 8888795

Please sign in to comment.