Skip to content

Commit e86233c

Browse files
committed
fix: remove client-side encryption_enabled check that references nonexistent Supabase field
The encryption_enabled field lives in the Go API's PostgreSQL, not in Supabase. The server-side admin rotate endpoint already rejects encrypted projects.
1 parent b4c0101 commit e86233c

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

dashboard/app/project/[id]/api-keys/actions.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,12 @@ export async function rotateSecretKey(projectId: string, apiKey?: string) {
8585
}
8686

8787
try {
88-
// Encrypted projects must use Bearer route to preserve master key
88+
// When an API key is available, use the Bearer route (preserves master key
89+
// for encrypted projects). Otherwise fall back to the admin route, which
90+
// will reject the request server-side if the project has encryption enabled.
8991
const client = new AcontextClient();
9092
let fullSecretKey: string;
91-
if (project.encryption_enabled) {
92-
if (!apiKey) {
93-
return { error: "Encrypted projects require a saved API key to rotate. Please save your API key first." };
94-
}
95-
fullSecretKey = await client.rotateProjectSecretKey(apiKey);
96-
} else if (apiKey) {
93+
if (apiKey) {
9794
fullSecretKey = await client.rotateProjectSecretKey(apiKey);
9895
} else {
9996
fullSecretKey = await client.rotateProjectSecretKeyAdmin(projectId);

0 commit comments

Comments
 (0)