diff --git a/packages/web/src/app/components/navigationMenu.tsx b/packages/web/src/app/components/navigationMenu.tsx
index 53c8d966..9aebba2e 100644
--- a/packages/web/src/app/components/navigationMenu.tsx
+++ b/packages/web/src/app/components/navigationMenu.tsx
@@ -5,8 +5,6 @@ import { Separator } from "@/components/ui/separator";
import Image from "next/image";
import logoDark from "../../../public/sb_logo_dark_small.png";
import logoLight from "../../../public/sb_logo_light_small.png";
-import { ProfilePicture } from "./profilePicture";
-import { signOut } from "@/auth";
import { SettingsDropdown } from "./settingsDropdown";
import { GitHubLogoIcon, DiscordLogoIcon } from "@radix-ui/react-icons";
import { redirect } from "next/navigation";
@@ -88,21 +86,6 @@ export const NavigationMenu = async () => {
-
-
diff --git a/packages/web/src/app/components/profilePicture.tsx b/packages/web/src/app/components/profilePicture.tsx
deleted file mode 100644
index 91b54d25..00000000
--- a/packages/web/src/app/components/profilePicture.tsx
+++ /dev/null
@@ -1,20 +0,0 @@
-import { auth } from "@/auth"
-import {
- Avatar,
- AvatarFallback,
- AvatarImage,
- } from "@/components/ui/avatar"
-
-export const ProfilePicture = async () => {
- const session = await auth()
-
- return (
-
-
- U
-
- )
- }
\ No newline at end of file
diff --git a/packages/web/src/app/components/settingsDropdown.tsx b/packages/web/src/app/components/settingsDropdown.tsx
index 86b20497..dcc85580 100644
--- a/packages/web/src/app/components/settingsDropdown.tsx
+++ b/packages/web/src/app/components/settingsDropdown.tsx
@@ -3,6 +3,7 @@
import {
CodeIcon,
Laptop,
+ LogOut,
Moon,
Settings,
Sun
@@ -12,7 +13,7 @@ import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuGroup,
- DropdownMenuLabel,
+ DropdownMenuItem,
DropdownMenuPortal,
DropdownMenuRadioGroup,
DropdownMenuRadioItem,
@@ -28,6 +29,10 @@ import { KeymapType } from "@/lib/types"
import { cn } from "@/lib/utils"
import { useKeymapType } from "@/hooks/useKeymapType"
import { NEXT_PUBLIC_SOURCEBOT_VERSION } from "@/lib/environment.client";
+import { useSession } from "next-auth/react";
+import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
+import { signOut } from "next-auth/react"
+
interface SettingsDropdownProps {
menuButtonClassName?: string;
@@ -38,7 +43,8 @@ export const SettingsDropdown = ({
}: SettingsDropdownProps) => {
const { theme: _theme, setTheme } = useTheme();
- const [ keymapType, setKeymapType ] = useKeymapType();
+ const [keymapType, setKeymapType] = useKeymapType();
+ const { data: session } = useSession();
const theme = useMemo(() => {
return _theme ?? "light";
@@ -64,9 +70,31 @@ export const SettingsDropdown = ({
-
- Settings
-
+
+ {session?.user && (
+
+
+
+
+
+ {session.user.name && session.user.name.length > 0 ? session.user.name[0] : 'U'}
+
+
+
{session.user.email ?? "User"}
+
+ {
+ signOut();
+ }}
+ >
+
+ Log out
+
+
+
+ )}
@@ -107,11 +135,11 @@ export const SettingsDropdown = ({
-
-
- version: {NEXT_PUBLIC_SOURCEBOT_VERSION}
-
+
+
+ version: {NEXT_PUBLIC_SOURCEBOT_VERSION}
+
)
diff --git a/packages/web/src/app/layout.tsx b/packages/web/src/app/layout.tsx
index 9a0f347a..44beffe9 100644
--- a/packages/web/src/app/layout.tsx
+++ b/packages/web/src/app/layout.tsx
@@ -1,11 +1,11 @@
import type { Metadata } from "next";
import "./globals.css";
import { ThemeProvider } from "next-themes";
-import { Suspense } from "react";
import { QueryClientProvider } from "./queryClientProvider";
import { PHProvider } from "./posthogProvider";
import { Toaster } from "@/components/ui/toaster";
import { TooltipProvider } from "@/components/ui/tooltip";
+import { SessionProvider } from "next-auth/react";
export const metadata: Metadata = {
title: "Sourcebot",
@@ -25,26 +25,22 @@ export default function RootLayout({
>
-
-
-
-
- {/*
- @todo : ideally we don't wrap everything in a suspense boundary.
- @see : https://nextjs.org/docs/messages/missing-suspense-with-csr-bailout
- */}
-
+
+
+
+
+
{children}
-
-
-
-
-
+
+
+
+
+