1
0
Fork 0
mirror of synced 2024-07-10 16:55:46 +12:00

Merge branch 'master' of github.com:Budibase/budibase

This commit is contained in:
Michael Shanks 2020-06-24 17:02:08 +01:00
commit b70d15e8b9

View file

@ -23,10 +23,7 @@
const login = async () => { const login = async () => {
loading = true loading = true
const response = await _bb.api.post("/api/authenticate", { const response = await _bb.api.post("/api/authenticate", { username, password })
username,
password,
})
if (response.status === 200) { if (response.status === 200) {
const json = await response.json() const json = await response.json()
localStorage.setItem("budibase:token", json.token) localStorage.setItem("budibase:token", json.token)
@ -39,7 +36,6 @@
} }
</script> </script>
<div class="container">
<div class="root"> <div class="root">
<div class="content"> <div class="content">
{#if logo} {#if logo}
@ -48,6 +44,26 @@
</div> </div>
{/if} {/if}
<h1 class="header-content">Log in to {name}</h1>
<div class="form-root">
<div class="control">
<input
bind:value={username}
type="text"
placeholder="Username"
class={_inputClass} />
</div>
<div class="control">
<input
bind:value={password}
type="password"
placeholder="Password"
class={_inputClass} />
</div>
</div>
<div class="login-button-container"> <div class="login-button-container">
<button disabled={loading} on:click={login} class={_buttonClass}> <button disabled={loading} on:click={login} class={_buttonClass}>
Log in to {name} Log in to {name}
@ -55,23 +71,12 @@
</div> </div>
{#if error} {#if error}
<div class="incorrect-details-panel"> <div class="incorrect-details-panel">Incorrect username or password</div>
Incorrect username or password
</div>
{/if} {/if}
</div> </div>
</div> </div>
</div>
<style> <style>
.container {
display: flex;
justify-content: center;
align-items: center;
height: 100%;
width: 100%;
position: absolute;
}
.root { .root {
height: 100%; height: 100%;
display: flex; display: flex;
@ -102,7 +107,7 @@
.header-content { .header-content {
font-family: Inter; font-family: Inter;
font-weight: 600; font-weight: 700;
color: #1f1f1f; color: #1f1f1f;
font-size: 48px; font-size: 48px;
line-height: 72px; line-height: 72px;