mirror of
https://github.com/formbricks/formbricks.git
synced 2026-02-11 18:58:45 -06:00
Co-authored-by: review-agent-prime[bot] <147289438+review-agent-prime[bot]@users.noreply.github.com>
27 lines
979 B
TypeScript
27 lines
979 B
TypeScript
export const loginRoute = (url: string) => url === "/api/auth/callback/credentials";
|
|
|
|
export const signupRoute = (url: string) => url === "/api/v1/users";
|
|
|
|
export const clientSideApiRoute = (url: string): boolean => {
|
|
if (url.includes("/api/v1/js/actions")) return true;
|
|
if (url.includes("/api/v1/client/storage")) return true;
|
|
const regex = /^\/api\/v\d+\/client\//;
|
|
return regex.test(url);
|
|
};
|
|
|
|
export const shareUrlRoute = (url: string): boolean => {
|
|
const regex = /\/share\/[A-Za-z0-9]+\/(summary|responses)/;
|
|
return regex.test(url);
|
|
};
|
|
|
|
export const isWebAppRoute = (url: string): boolean =>
|
|
url.startsWith("/environments") && url !== "/api/auth/signout";
|
|
|
|
export const isSyncWithUserIdentificationEndpoint = (
|
|
url: string
|
|
): { environmentId: string; userId: string } | false => {
|
|
const regex = /\/api\/v1\/client\/([^/]+)\/in-app\/sync\/([^/]+)/;
|
|
const match = url.match(regex);
|
|
return match ? { environmentId: match[1], userId: match[2] } : false;
|
|
};
|