Clerk: Next.js SignOutButton SignOutOptions, not working
09:16 17 Jun 2024

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

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}

{link.label}

); })}
logout

Logout

); }

I'm trying to redirect my user to /sign-in when they logout

next.js clerk