Feature: User auth #15
|
@ -7,8 +7,8 @@ const name = ref("")
|
|||
const password = ref("")
|
||||
const signUpWait = ref(false)
|
||||
const loginWait = ref(false)
|
||||
const signUpClass = computed(() => `submit button is-success ${signUpWait ? 'is-loading' : ''}`)
|
||||
const loginClass = computed(() => `submit button is-success ${loginWait ? 'is-loading' : ''}`)
|
||||
const signUpClass = computed(() => `submit button is-success ${signUpWait.value ? 'is-loading' : ''}`)
|
||||
const loginClass = computed(() => `submit button is-info ${loginWait.value ? 'is-loading' : ''}`)
|
||||
|
||||
async function signUp() {
|
||||
const $name = name.value
|
||||
|
@ -40,6 +40,8 @@ async function login() {
|
|||
}
|
||||
}
|
||||
|
||||
if(state.user?.name) router.push("/")
|
||||
|
||||
</script>
|
||||
<template>
|
||||
<div class="modal is-active">
|
||||
|
@ -50,7 +52,7 @@ async function login() {
|
|||
</header>
|
||||
<section class="modal-card-body">
|
||||
<div class="field">
|
||||
<label for="username">Name</label>
|
||||
<label for="username" class=label>Name</label>
|
||||
<div class="control">
|
||||
<input type="text" name="username" class="input" v-model="name" />
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue