MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / nuke

Function nuke

apps/web/src/components/dev/actions.ts:9–30  ·  view source on GitHub ↗
(kiloUserId: string)

Source from the content-addressed store, hash-verified

7import { getUserFromAuth } from '@/lib/user/server';
8import { captureException } from '@sentry/nextjs';
9
10export async function nuke() {
11 if (!IS_DEVELOPMENT) {
12 throw new Error('Nuke is only available in development');
13 }
14
15 const { user, authFailedResponse } = await getUserFromAuth({ adminOnly: false });
16 if (authFailedResponse || !user) {
17 throw new Error('Unauthorized');
18 }
19
20 try {
21 const current = await findUserById(user.id);
22 if (!current) {
23 throw new Error(`User not found: ${user.id}`);
24 }
25
26 await softDeleteUser(user.id);
27 } catch (error) {
28 console.error('Error nuking account:', error);
29 captureException(error, {
30 tags: { source: 'dev_nuke_account' },
31 extra: { kiloUserId: user.id },
32 level: 'error',
33 });

Callers 1

DevNukeAccountButtonFunction · 0.90

Calls 5

findUserByIdFunction · 0.90
revokeWebSessionsFunction · 0.90
softDeleteUserFunction · 0.90
deleteStripeCustomerFunction · 0.90
errorMethod · 0.65

Tested by

no test coverage detected