Budibase is an open-source low-code platform for creating internal apps in minutes. Supports PostgreSQL, MySQL, MSSQL, MongoDB, Rest API, Docker, K8s 🚀
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

59 lines
1.2 KiB

<script>
import { goto } from "@roxi/routify"
import {
notifications,
Link,
Input,
Modal,
ModalContent,
} from "@budibase/bbui"
import { auth } from "stores/backend"
let username = ""
let password = ""
async function login() {
try {
await auth.login({
username,
password,
})
notifications.success("Logged in successfully")
$goto("../portal")
} catch (err) {
console.error(err)
notifications.error("Invalid credentials")
}
}
</script>
<Modal fixed>
<ModalContent
size="M"
title="Log In"
onConfirm={login}
confirmText="Log In"
showCancelButton={false}
showCloseIcon={false}
>
<Input label="Email" bind:value={username} />
<Input label="Password" type="password" on:change bind:value={password} />
<div class="footer" slot="footer">
<Link target="_blank" href="/api/admin/auth/google">
Sign In With Google
</Link>
</div>
</ModalContent>
</Modal>
<style>
.footer {
display: flex;
flex-direction: row;
justify-content: flex-end;
align-items: center;
}
.footer :global(a) {
margin-right: var(--spectrum-global-dimension-static-size-200);
}
</style>