This commit is contained in:
Timur Ercan
2023-01-13 19:01:58 +01:00
parent ef59ab1688
commit 3baed98d08
4 changed files with 70 additions and 34 deletions

View File

@@ -51,9 +51,22 @@ const userNavigation = [
href: "",
click: async (e: any) => {
e.preventDefault();
const res: any = await signOut({ callbackUrl: "/login" }).finally(() => {
if (!res?.error) toast.success("Logout successful");
});
const res: any = await toast.promise(
signOut({ callbackUrl: "/login" }),
{
loading: "Logging out",
success: "Your are logged out.",
error: "Could not log out :/",
},
{
style: {
minWidth: "200px",
},
success: {
duration: 10000,
},
}
);
},
icon: ArrowRightOnRectangleIcon,
},
@@ -229,7 +242,7 @@ export default function TopNavigation() {
</>
)}
</Disclosure>
<Toaster position="top-center"></Toaster>
{/* <Toaster position="top-center"></Toaster> */}
</>
);
}