I'm trying to make my user go back to /sign-in after he clicked on the button to logout
I have no console error no syntax error in my IDE, and my path /sign-in work but for some reason the SignOutOption I've used didn't change my url on click.
Here is a snippet of my code where I've used the option:
Logout
I'm new to clerk and I didn't find example of signOutOptions in the documentation so I apologize if you have find one.
Here is my full code:
"use client";
import { sidebarLinks } from "@/constants";
import { SignOutButton, SignedIn } from "@clerk/nextjs";
import Image from "next/image";
import Link from "next/link";
import { usePathname, useRouter } from "next/navigation";
export default function LeftSidebar() {
const router = useRouter();
const pathname = usePathname();
return (
{sidebarLinks.map((link) => {
const isActive =
(pathname.includes(link.route) && link.route.length > 1) ||
pathname === link.route;
return (
{link.label}
);
})}
Logout
);
}
I'm trying to redirect my user to /sign-in when they logout