From fe2219dcd2a50c47d47a2b26d8e6de108ba5db87 Mon Sep 17 00:00:00 2001 From: Timur Ercan Date: Wed, 4 Jan 2023 14:37:33 +0100 Subject: [PATCH] login logout redirects, session, remove out of scope code --- apps/web/components/layout.tsx | 5 +- apps/web/components/login.tsx | 2 +- apps/web/components/settings.tsx | 163 ----------------------- apps/web/pages/_app.tsx | 12 +- apps/web/pages/api/auth/[...nextauth].ts | 4 +- apps/web/pages/documents.tsx | 12 +- 6 files changed, 24 insertions(+), 174 deletions(-) diff --git a/apps/web/components/layout.tsx b/apps/web/components/layout.tsx index 5964577c9..44310c5f3 100644 --- a/apps/web/components/layout.tsx +++ b/apps/web/components/layout.tsx @@ -27,10 +27,10 @@ const userNavigation = [ { name: "Your Profile", href: "/settings" }, { name: "Sign out", - href: "/login", + href: "", click: (e: any) => { e.preventDefault(); - signOut(); + signOut({ callbackUrl: "/login" }); }, }, ]; @@ -41,7 +41,6 @@ function classNames(...classes: any) { export default function Layout({ children }: any) { const router = useRouter(); - navigation.forEach((element) => { element.current = element.href == router.route; }); diff --git a/apps/web/components/login.tsx b/apps/web/components/login.tsx index 42c9b400c..67b3bc386 100644 --- a/apps/web/components/login.tsx +++ b/apps/web/components/login.tsx @@ -80,7 +80,7 @@ export default function Example() {