Cant delete API_Key

I get 404 when using the delete. _ const handleDelete = async () => { if (!selectedKey) return;
setLoading(true); try { // Log the key ID for debugging console.log('Attempting to delete API key with ID:', selectedKey.id); const { data: result, error } = await authClient.apiKey.delete({ keyId: selectedKey.id, }); -------------------------------------------------- I can create, edit, list, just cant delete them.
No description
No description
8 Replies
Samphire
SamphireOP2mo ago
anyone? :c I cant get it to work so it has to be a bug. I will just do it manually for now.
Ping
Ping2mo ago
The PR with this fix is merged, should be fixed by next release.
Samphire
SamphireOP2mo ago
I am glade I am not crazy, I though I was doing something wrong. It also didnt work on server! It also didnt work on server!
Ping
Ping2mo ago
Can you show me your auth config?
Samphire
SamphireOP2mo ago
you mean this? import { betterAuth } from "better-auth"; import { drizzleAdapter } from "better-auth/adapters/drizzle"; import { db } from "../db"; import * as schema from "../db/schema"; import { apiKey } from "better-auth/plugins"; export const auth = betterAuth({ plugins: [ // Use default options for apiKey plugin apiKey(), ], database: drizzleAdapter(db, { provider: "pg", schema: schema, }), trustedOrigins: [process.env.CORS_ORIGIN!], emailAndPassword: { enabled: true, }, });
Ping
Ping2mo ago
Looks about right. Not sure what could be wrong, but we have unit-tests to make sure this works on the server auth api
Samphire
SamphireOP2mo ago
I am telling you man everything works but the delete

Did you find this page helpful?