fix: user authentication on the index page (#2619)

* fix: user authentication on the index page

* fix: login redirection cleanup

---------

Co-authored-by: sriram veeraghanta <veeraghanta.sriram@gmail.com>
This commit is contained in:
Aaryan Khandelwal 2023-11-03 12:42:43 +05:30 committed by GitHub
parent 5efc6993cd
commit 260974b0de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 46 additions and 57 deletions

View file

@ -3,7 +3,6 @@ import { useRouter } from "next/router";
import { observer } from "mobx-react-lite";
import Link from "next/link";
import { Menu, Transition } from "@headlessui/react";
import { useTheme } from "next-themes";
import { Check, LogOut, Plus, Settings, UserCircle2 } from "lucide-react";
// mobx store
import { useMobxStore } from "lib/mobx/store-provider";
@ -55,8 +54,6 @@ export const WorkspaceSidebarDropdown = observer(() => {
const { workspaces, currentWorkspace: activeWorkspace } = workspaceStore;
const user = userStore.currentUser;
const { setTheme } = useTheme();
const { setToastAlert } = useToast();
const handleWorkspaceNavigation = (workspace: IWorkspace) => {
@ -81,7 +78,6 @@ export const WorkspaceSidebarDropdown = observer(() => {
.signOut()
.then(() => {
router.push("/");
setTheme("system");
})
.catch(() =>
setToastAlert({