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.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

38 lines
791B

  1. <script>
  2. import { loading } from '../stores'
  3. import { login } from '../actions'
  4. let username = ''
  5. let password = ''
  6. let remember = false
  7. async function submitForm () {
  8. await login({ username, password, remember_me: remember })
  9. }
  10. </script>
  11. <form on:keydown.enter={submitForm}>
  12. <h1>Login</h1>
  13. <fieldset>
  14. <label>Username</label>
  15. <input bind:value={username} type="text" />
  16. </fieldset>
  17. <fieldset>
  18. <label>Password</label>
  19. <input bind:value={password} type="password" />
  20. </fieldset>
  21. <fieldset>
  22. <label class="text--vmid">
  23. <input bind:checked={remember} type="checkbox" class="text--vmid" />
  24. Remember me
  25. </label>
  26. </fieldset>
  27. <button disabled={$loading} on:click|preventDefault={submitForm}>
  28. Submit
  29. </button>
  30. </form>