better-auth/apps/web/modules/shared/lib/cache.ts

16 lines
293 B
TypeScript
Raw Permalink Normal View History

2025-10-29 13:43:43 +05:00
"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);
}
};