From 2e831eaf74e06cbfa7528b6849fcc25037439097 Mon Sep 17 00:00:00 2001 From: Alexis Aguilar <98043211+alexisintech@users.noreply.github.com> Date: Tue, 17 Sep 2024 15:52:38 -0400 Subject: [PATCH] Update code example for deleting a user --- docs/users/deleting-users.mdx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/users/deleting-users.mdx b/docs/users/deleting-users.mdx index 677a155044..f7c0018e0b 100644 --- a/docs/users/deleting-users.mdx +++ b/docs/users/deleting-users.mdx @@ -20,14 +20,14 @@ To delete users using the Clerk API, you can use the [`deleteUser()`](/docs/refe ```ts {{ filename: 'app/api/delete-user/route.ts' }} - import { auth, clerkClient } from '@clerk/nextjs/server' + import { clerkClient } from '@clerk/nextjs/server' import { NextResponse } from 'next/server' export async function DELETE() { - const { userId } = auth() + const userId = 'user_123' try { - await clerkClient.users.deleteUser(userId) + await clerkClient().users.deleteUser(userId) return NextResponse.json({ message: 'User deleted' }) } catch (error) { console.log(error) @@ -56,8 +56,8 @@ To delete users using the Clerk API, you can use the [`deleteUser()`](/docs/refe - ```bash {{ filename: 'curl.sh' }} - curl -XDELETE -H 'Authorization: CLERK_SECRET_KEY' 'https://api.clerk.com/v1/users/{user_id}' + ```bash {{ filename: 'terminal' }} + curl 'https://api.clerk.com/v1/users/{user_id}' -X DELETE -H 'Authorization:Bearer {{secret}}' -H 'Content-Type:application/json' ```