diff --git a/apps/web/components/layout/nav.tsx b/apps/web/components/layout/nav.tsx
index 6cd195e..4813032 100644
--- a/apps/web/components/layout/nav.tsx
+++ b/apps/web/components/layout/nav.tsx
@@ -1,7 +1,7 @@
"use client";
import Link from "next/link";
-import { usePathname } from "next/navigation";
+import { usePathname, useRouter } from "next/navigation";
import { BookOpen, Calendar, Package, ChefHat, User, Rss, FolderOpen, ShoppingCart, Shield, Search, Compass, Menu } from "lucide-react";
import { cn } from "@/lib/utils";
import { Button, buttonVariants } from "@/components/ui/button";
@@ -36,6 +36,7 @@ const NAV_ITEMS = [
export function Nav() {
const pathname = usePathname();
+ const router = useRouter();
const { data: session } = authClient.useSession();
const isAdmin = (session?.user as { role?: string } | undefined)?.role === "admin";
const t = useTranslations("nav");
@@ -124,7 +125,18 @@ export function Nav() {
>
)}
- authClient.signOut()}>
+ {
+ void authClient.signOut({
+ fetchOptions: {
+ onSuccess: () => {
+ router.push("/login");
+ router.refresh();
+ },
+ },
+ });
+ }}
+ >
{t("signOut")}
diff --git a/apps/web/lib/auth/server.ts b/apps/web/lib/auth/server.ts
index 07e0dfa..b7d1e54 100644
--- a/apps/web/lib/auth/server.ts
+++ b/apps/web/lib/auth/server.ts
@@ -100,6 +100,9 @@ export const auth = betterAuth({
},
user: {
+ fields: {
+ image: "avatarUrl",
+ },
additionalFields: {
role: {
type: "string",