Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

Don't remove last api key

Jakub Novakcc7967fb6e5b
diff --git a/apps/docs/src/components/Dashboard/Keys.tsx b/apps/docs/src/components/Dashboard/Keys.tsx
index 2899af297..eaa5a3fea 100644
--- a/apps/docs/src/components/Dashboard/Keys.tsx
+++ b/apps/docs/src/components/Dashboard/Keys.tsx
@@ -45,7 +45,14 @@ export const KeysContent = ({ user, currentTeam, currentApiKey }: { user: User,
}
const deleteApiKey = async() => {
-
+ if (apiKeys.length === 1) {
+ toast({
+ title: 'Cannot delete the last API key',
+ description: 'You must have at least one API key',
+ })
+ return
+ }
+
const { error } = await supabase
.from('team_api_keys')
.delete()