diff --git a/src/routes/(console)/(redirects)/members/+page.ts b/src/routes/(console)/(redirects)/members/+page.ts new file mode 100644 index 0000000000..7e1572b965 --- /dev/null +++ b/src/routes/(console)/(redirects)/members/+page.ts @@ -0,0 +1,13 @@ +import { redirect } from '@sveltejs/kit'; +import { base } from '$app/paths'; +import type { PageLoad } from './$types'; + +export const load: PageLoad = async ({ parent }) => { + const { organizations, account } = await parent(); + + const teamId = account.prefs.organization ?? organizations.teams[0]?.$id; + if (teamId) { + redirect(303, `${base}/organization-${teamId}/members`); + } + redirect(303, base); +};