allow signout

This commit is contained in:
Saatvik Arya 2024-07-23 00:33:03 -07:00
parent f310781ad7
commit 875963c4c2
2 changed files with 19 additions and 0 deletions

View file

@ -6,6 +6,7 @@ import Logo from "../../../public/logo.svg";
import { getChatHistory } from "../../actions/fetchers";
import NewChatButton from "./newChatButton";
import AutoBreadCrumbs from "./autoBreadCrumbs";
import SignOutButton from "./signOutButton";
async function Header() {
const chatThreads = await getChatHistory();
@ -52,6 +53,7 @@ async function Header() {
</div>
</div>
</div>
<SignOutButton />
</div>
</div>
</div>

View file

@ -0,0 +1,17 @@
import { signOut } from "@/server/auth";
import { Button } from "@repo/ui/shadcn/button";
export default function SignOutButton() {
return (
<form
action={async () => {
"use server"
await signOut()
}}
>
<Button variant="ghost" size="sm" type="submit">
Sign Out
</Button>
</form>
);
}