Fixed a crash if unexpected key was passed

This commit is contained in:
WardPearce
2026-03-08 23:10:14 +13:00
parent fa3965f7be
commit 1a8fb26d9b
@@ -3,7 +3,7 @@ import { getUser } from '$lib/server/user';
import { error, json } from '@sveltejs/kit';
import z from 'zod';
async function keyAllowed(key: string) {
function keyAllowed(key: string) {
if (!persistedStoreKeys.includes(key)) throw error(400);
}
@@ -19,7 +19,6 @@ export async function DELETE({ locals, params }) {
keyAllowed(params.key);
const user = await getUser(locals.userId);
await user.deleteKeyValue(params.key);
return new Response();