This commit is contained in:
Sebastian 2023-09-26 07:45:45 -03:00
parent 6024d0125e
commit dcdf8fb6a0
No known key found for this signature in database
GPG Key ID: 173909D1A5F66069

View File

@ -55,6 +55,10 @@ export function LoginForm({ onRegister }: { onRegister?: () => void }): VNode {
notifyError(title, description, debug) notifyError(title, description, debug)
} }
async function doLogout() {
backend.logOut()
}
async function doLogin() { async function doLogin() {
if (!username || !password) return; if (!username || !password) return;
setBusy({}) 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" 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) => { onClick={(e) => {
e.preventDefault() e.preventDefault()
doLogin() doLogout()
}} }}
> >
<i18n.Translate>Cancel</i18n.Translate> <i18n.Translate>Cancel</i18n.Translate>