feat: add feed

This commit is contained in:
gosangam
2026-06-14 00:18:31 +05:30
parent eb0c981d3c
commit 61581b67a7
9 changed files with 395 additions and 47 deletions
+5
View File
@@ -9,6 +9,7 @@ import {
useState,
} from "react";
import { auth, type User } from "@/lib/auth";
import { feed } from "@/lib/social";
/**
* AuthProvider holds the current-user state and exposes the auth actions
@@ -89,6 +90,10 @@ export function AuthProvider({ children }: { children: React.ReactNode }) {
);
const logOut = useCallback(async () => {
// Drop the home-feed seen-set first, while the auth cookie is still set
// (the reset endpoint is auth-gated). Best-effort — a stale set would
// otherwise expire on its own TTL.
await feed.reset().catch(() => {});
await auth.logOut();
setUser(null);
}, []);