better-auth/apps/web/modules/shared/lib/cache.ts
 Илья Шалонин 8538ab969a first
2025-10-29 13:43:43 +05:00

15 lines
293 B
TypeScript

"use server";
import { revalidatePath } from "next/cache";
export const clearCache = async (path?: string) => {
try {
if (path) {
revalidatePath(path);
} else {
revalidatePath("/", "layout");
}
} catch (error) {
console.error("Could not revalidate path", path, error);
}
};