Refactor sign-out functionality in Header component to use async/await for improved navigation handling, ensuring a smoother user experience during logout.
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 2m40s
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 2m40s
This commit is contained in:
@@ -30,7 +30,10 @@ export function Header() {
|
||||
<span className="text-zinc-400 dark:text-zinc-500">{session?.user?.email}</span>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => signOut({ callbackUrl: "/auth/login" })}
|
||||
onClick={async () => {
|
||||
await signOut({ redirect: false });
|
||||
window.location.href = "/auth/login";
|
||||
}}
|
||||
className="text-zinc-500 hover:text-red-500 dark:text-zinc-400 dark:hover:text-red-400 transition-colors"
|
||||
>
|
||||
déconnexion
|
||||
|
||||
Reference in New Issue
Block a user