From 0117cdfa5417762ede681546e070d74b4f4848f4 Mon Sep 17 00:00:00 2001 From: Jared Palmer Date: Wed, 21 Jun 2023 14:42:18 -0700 Subject: [PATCH] Fix auth --- components/header.tsx | 23 +++++++++++------------ components/login-button.tsx | 1 + 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/components/header.tsx b/components/header.tsx index b08bd46..24a3e45 100644 --- a/components/header.tsx +++ b/components/header.tsx @@ -4,7 +4,7 @@ import Link from 'next/link' import { cn } from '@/lib/utils' import { auth } from '@/auth' import { clearChats } from '@/app/actions' -import { buttonVariants } from '@/components/ui/button' +import { Button, buttonVariants } from '@/components/ui/button' import { Sidebar } from '@/components/sidebar' import { SidebarList } from '@/components/sidebar-list' import { @@ -22,7 +22,7 @@ import { LoginButton } from '@/components/login-button' export async function Header() { const session = await auth() return ( -
+
{session?.user ? ( @@ -37,21 +37,20 @@ export async function Header() { ) : ( - - + + )}
- + {session?.user ? ( ) : ( - + )}
@@ -63,7 +62,7 @@ export async function Header() { className={cn(buttonVariants({ variant: 'outline' }))} > - GitHub + GitHub { setIsLoading(true) + // next-auth signIn() function doesn't work yet at Edge Runtime due to usage of BroadcastChannel signIn('github', { callbackUrl: `/` }) }} disabled={isLoading}