export const authOrRedirect = cache(async (url?: string) => { "use server"; const sess = await getAuthSession(); if (!sess.data.user) { return redirect(url || "/auth/login", 302); } const dbSess = await getUnexpiredSession(sess.data.id); if (!dbSess) { await logout(); return redirect(url || "/auth/login", 302); } return sess;}, "authRedirect");