Skip to content

Commit 5a664da

Browse files
committed
logout fix
1 parent e287d01 commit 5a664da

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

components/dashboardComponents/AppSidebar.tsx

+3-4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { Button } from "@/components/ui/button";
1616
import { cn } from "@/lib/utils";
1717
import { SidebarData } from "@/data/SidebarData";
1818
import { supabase } from "@/lib/supabaseClient";
19+
import { signout } from "@/app/actions/action";
1920

2021
export function AppSidebar() {
2122
const { setTheme, theme } = useTheme();
@@ -24,13 +25,11 @@ export function AppSidebar() {
2425
const [isCollapsed, setIsCollapsed] = React.useState(false);
2526
const handleLogout = async () => {
2627
try {
27-
const { error } = await supabase.auth.signOut();
28-
if (error) throw error;
28+
signout();
2929
router.push('/auth/signin');
3030
} catch (error) {
3131
console.error("Sign out error:", error);
32-
}
33-
// Fix the Logout functionality, something is wrong here, It keeps throwing a 307 error on logout,and the user is not redirected to the login page
32+
}
3433
};
3534

3635
return (

package-lock.json

+11-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
"@radix-ui/react-tooltip": "^1.1.6",
2424
"@supabase/ssr": "^0.5.2",
2525
"@types/bcryptjs": "^2.4.6",
26-
"@types/express": "^5.0.0",
2726
"@types/react-chartjs-2": "^2.0.2",
2827
"axios": "^1.7.9",
2928
"bcryptjs": "^2.4.3",
@@ -49,6 +48,7 @@
4948
"@eslint/eslintrc": "^3",
5049
"@supabase/auth-helpers-nextjs": "^0.10.0",
5150
"@supabase/supabase-js": "^2.47.11",
51+
"@types/express": "^5.0.0",
5252
"@types/node": "^20",
5353
"@types/react": "^19",
5454
"@types/react-dom": "^19",

0 commit comments

Comments
 (0)