feat: add feed
This commit is contained in:
@@ -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);
|
||||
}, []);
|
||||
|
||||
Reference in New Issue
Block a user