From 76391d82e840027a5cc8f4858f1d80452440491d Mon Sep 17 00:00:00 2001 From: Federico Minaya Date: Sat, 4 Mar 2023 19:18:40 -0300 Subject: [PATCH] fix: sign out refresh --- examples/full-example/src/components/Buttons.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/examples/full-example/src/components/Buttons.tsx b/examples/full-example/src/components/Buttons.tsx index 24e8344..04c570d 100644 --- a/examples/full-example/src/components/Buttons.tsx +++ b/examples/full-example/src/components/Buttons.tsx @@ -1,10 +1,19 @@ 'use client'; import { signIn, signOut } from 'next-auth/react'; +import { useRouter } from 'next/navigation'; export const SignInButton = () => { return ; }; export const SignOutButton = () => { - return ; + const router = useRouter(); + + const handleClick = async () => { + await signOut({ redirect: false }); + + router.refresh(); + }; + + return ; };