|
1 | 1 | import { getActiveOrganizationId } from '@/lib/auth/session-response' |
2 | 2 | import { isKnowledgeMemberAccessAvailable } from '@/lib/knowledge/access/availability' |
3 | | -import { |
4 | | - organizationRoutes, |
5 | | - WORKSPACE_SETTINGS_PATH, |
6 | | - WORKSPACES_PATH, |
7 | | -} from '@/lib/navigation/paths' |
| 3 | +import { organizationRoutes, WORKSPACES_PATH } from '@/lib/navigation/paths' |
8 | 4 | import { resolveOrganizationLanding } from '@/lib/organizations/surface' |
9 | 5 |
|
10 | 6 | interface EntrySession { |
11 | 7 | user: { id: string } |
12 | 8 | } |
13 | 9 |
|
14 | 10 | /** |
15 | | - * Routes organization members to Home when Search is enabled and workspace settings otherwise. |
16 | | - * Viewers without an organization land on the workspace picker. |
| 11 | + * Routes organization members to Home when the organization surface is enabled for |
| 12 | + * them. Everyone else — viewers without an organization, and members whose |
| 13 | + * organization has not been rolled out — lands on the workspace picker, which is |
| 14 | + * where the signed-in app's front door pointed before the organization surface |
| 15 | + * existed. The default landing never opens settings: a viewer who did not ask for |
| 16 | + * settings must not be dropped into them. |
17 | 17 | */ |
18 | 18 | export async function resolveAppEntryPath(session: EntrySession): Promise<string> { |
19 | 19 | const organizationId = await resolveOrganizationLanding( |
20 | 20 | session.user.id, |
21 | 21 | getActiveOrganizationId(session) |
22 | 22 | ) |
23 | 23 | if (!organizationId) return WORKSPACES_PATH |
24 | | - const routes = organizationRoutes(organizationId) |
25 | 24 | return (await isKnowledgeMemberAccessAvailable({ organizationId })) |
26 | | - ? routes.home |
27 | | - : WORKSPACE_SETTINGS_PATH |
| 25 | + ? organizationRoutes(organizationId).home |
| 26 | + : WORKSPACES_PATH |
28 | 27 | } |
0 commit comments