Skip to content

Commit c793f0d

Browse files
committed
fix: let permission-denied redirect propagate in org settings action
1 parent ef01e12 commit c793f0d

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

apps/webapp/app/routes/_app.orgs.$organizationSlug.settings._index/route.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,9 @@ export const action = dashboardAction(
295295
}
296296
}
297297
} catch (error: unknown) {
298+
// Permission checks throw a redirect Response (toast) — let it through
299+
// rather than flattening it into a generic 400.
300+
if (error instanceof Response) throw error;
298301
const message = error instanceof Error ? error.message : "An unexpected error occurred";
299302
return json({ errors: { body: message } }, { status: 400 });
300303
}

apps/webapp/app/routes/api.v1.orgs.$orgParam.projects.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ export const action = createActionPATApiRoute(
7777
});
7878
return org ? { organizationId: org.id } : {};
7979
},
80-
// authorization intentionally omitted — gating TBD
80+
// No authorization gate: creating a project is a member-level action
81+
// (mirrors the dashboard), not an owner-only one like rename/delete.
8182
},
8283
async ({ params, body, authentication }) => {
8384
const organization = await prisma.organization.findFirst({

0 commit comments

Comments
 (0)