From dcdf8fb6a067b4e40b13f1c0f106758cfba76309 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Tue, 26 Sep 2023 07:45:45 -0300 Subject: [PATCH] logout --- packages/demobank-ui/src/pages/LoginForm.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/demobank-ui/src/pages/LoginForm.tsx b/packages/demobank-ui/src/pages/LoginForm.tsx index 0fbbef7c3..786399d55 100644 --- a/packages/demobank-ui/src/pages/LoginForm.tsx +++ b/packages/demobank-ui/src/pages/LoginForm.tsx @@ -55,6 +55,10 @@ export function LoginForm({ onRegister }: { onRegister?: () => void }): VNode { notifyError(title, description, debug) } + async function doLogout() { + backend.logOut() + } + async function doLogin() { if (!username || !password) return; setBusy({}) @@ -198,7 +202,7 @@ export function LoginForm({ onRegister }: { onRegister?: () => void }): VNode { class="rounded-md bg-white-600 px-3 py-1.5 text-sm font-semibold leading-6 text-black shadow-sm hover:bg-gray-100 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gray-600" onClick={(e) => { e.preventDefault() - doLogin() + doLogout() }} > Cancel