13 lines
404 B
TypeScript
13 lines
404 B
TypeScript
import { eq } from 'drizzle-orm';
|
|
import { recoveryLinks } from '~~/drizzle/schema';
|
|
import { db } from '~~/server/lib/db';
|
|
|
|
/** Cancels the recovery link of a user, if there is one. */
|
|
export default defineEventHandler(async (event) => {
|
|
await protectAdminRoute(event);
|
|
|
|
await db.delete(recoveryLinks).where(eq(recoveryLinks.userId, getRouterParam(event, 'id')!));
|
|
|
|
return { ok: true };
|
|
});
|