From 0c398f1b92548bb1d0a87f439a64be2cf3235682 Mon Sep 17 00:00:00 2001 From: Bereket Engida Date: Sat, 5 Oct 2024 21:24:21 +0300 Subject: [PATCH] docs: fix nav layout --- docs/app/layout.tsx | 1 - docs/components/nav-bar.tsx | 54 +++++++++---------- docs/components/nav-mobile.tsx | 4 +- docs/components/theme-toggler.tsx | 39 +++++++------- .../better-auth/src/api/routes/sign-out.ts | 5 +- 5 files changed, 52 insertions(+), 51 deletions(-) diff --git a/docs/app/layout.tsx b/docs/app/layout.tsx index 36d3be2fa0..57df9c4919 100644 --- a/docs/app/layout.tsx +++ b/docs/app/layout.tsx @@ -29,7 +29,6 @@ export default function Layout({ children }: { children: ReactNode }) { > - {children} diff --git a/docs/components/nav-bar.tsx b/docs/components/nav-bar.tsx index ef6cfb1b2f..4a6be411bc 100644 --- a/docs/components/nav-bar.tsx +++ b/docs/components/nav-bar.tsx @@ -1,39 +1,39 @@ +import React from "react"; import Link from "next/link"; import { ThemeToggle } from "@/components/theme-toggler"; -import Image from "next/image"; -import { NavbarMobileBtn } from "./nav-mobile"; +import { NavbarMobile, NavbarMobileBtn } from "./nav-mobile"; import { NavLink } from "./nav-link"; import { Logo } from "./logo"; -import { PulicBetaBadge } from "./beta/badge"; -import { useState } from "react"; -import { MenuIcon, X } from "lucide-react"; export const Navbar = () => { return ( - + + ); }; diff --git a/docs/components/nav-mobile.tsx b/docs/components/nav-mobile.tsx index 7b6dfdb902..854c17b2b8 100644 --- a/docs/components/nav-mobile.tsx +++ b/docs/components/nav-mobile.tsx @@ -57,10 +57,10 @@ export const NavbarMobileBtn: React.FC = () => { const { toggleNavbar } = useNavbarMobile(); return ( -
+
- ) : ( - - )} +
+ +
); } diff --git a/packages/better-auth/src/api/routes/sign-out.ts b/packages/better-auth/src/api/routes/sign-out.ts index 17da2e1542..9527ace798 100644 --- a/packages/better-auth/src/api/routes/sign-out.ts +++ b/packages/better-auth/src/api/routes/sign-out.ts @@ -1,6 +1,7 @@ import { z } from "zod"; import { createAuthEndpoint } from "../call"; import { deleteSessionCookie } from "../../utils/cookies"; +import { APIError } from "better-call"; export const signOut = createAuthEndpoint( "/sign-out", @@ -18,7 +19,9 @@ export const signOut = createAuthEndpoint( ctx.context.secret, ); if (!sessionCookieToken) { - return ctx.json(null); + throw new APIError("BAD_REQUEST", { + message: "Session not found", + }); } await ctx.context.internalAdapter.deleteSession(sessionCookieToken); deleteSessionCookie(ctx);