* Chore disable git submodule for web-client and app-backend * Chore add newest source code of app-backend and web-client --------- Co-authored-by: Hien To <tominhhien97@gmail.com>
14 lines
321 B
TypeScript
14 lines
321 B
TypeScript
import { signOut as signOutNextAuth } from "next-auth/react";
|
|
|
|
export default function useSignOut() {
|
|
const signOut = () => {
|
|
fetch(`api/auth/logout`, { method: "GET" })
|
|
.then(() => signOutNextAuth({ callbackUrl: "/" }))
|
|
.catch((e) => {
|
|
console.error(e);
|
|
});
|
|
};
|
|
|
|
return { signOut };
|
|
}
|