(request: NextRequest)
| 11 | const SAFE_ORGANIZATION_POST_PATHS = new Set(['organization/check-slug', 'organization/set-active']) |
| 12 | |
| 13 | function getAuthPath(request: NextRequest): string { |
| 14 | const pathname = request.nextUrl?.pathname ?? new URL(request.url).pathname |
| 15 | return pathname.replace('/api/auth/', '') |
| 16 | } |
| 17 | |
| 18 | function isBlockedOrganizationMutationPath(path: string): boolean { |
| 19 | return path.startsWith('organization/') && !SAFE_ORGANIZATION_POST_PATHS.has(path) |