Next.js Discord

Discord Forum

Redirecting to page from Login and logout was performed

Unanswered
Maltese posted this in #help-forum
Open in Discord
MalteseOP
const Navabar = () => {

  const pathName = usePathname();

  const session = useSession({});

  return    {session?.status != "authenticated" ? <Link href={`/api/auth/signin?callbackUrl=${pathName}`} >
                <span className="text-white">Login</span>
              </Link> : <div className="flex items-center gap-4"><Link href={`/api/auth/signout?callbackUrl=${pathName}`} >
              <span className="text-white">Logout</span>
              </Link> <Link href='/cart'>
                    {/* <div class="absolute inline-flex items-center justify-center w-6 h-6 text-xs font-bold text-white bg-blue-500 border-2 border-white rounded-full top-0 end-0 dark:border-gray-900">
                      {products}
                    </div> */}
                  <span className="text-white"><ShoppingCart /></span></Link></div>}
}


Still whenever i login it gets redirected to '/cart'

0 Replies