wip: implementando tela de cadastro do usuário

This commit is contained in:
2026-04-27 20:24:34 -05:00
parent 36a1875ee6
commit 7354c28a8e
4 changed files with 97 additions and 131 deletions

View File

@@ -1,6 +1,5 @@
<template>
<div>
<NuxtRouteAnnouncer />
<NuxtWelcome />
</div>
<NuxtLayout>
<NuxtPage />
</NuxtLayout>
</template>

View File

@@ -0,0 +1,35 @@
<template>
<div>
<h1>Oooiiii</h1>
<label for="email">Email: </label>
<input v-model="formData.email" type="text" id="email" name="email" />
<label for="senha">Senha: </label>
<input v-model="formData.password" type="password" id="senha" name="senha" />
<button @click="criarConta">Criar Conta</button>
</div>
</template>
<script setup>
const formData = reactive({
email: '',
password: ''
})
async function criarConta() {
try {
(await fetch('/auth/register', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
email: formData.email,
password: formData.password
})
}))()
} catch (error) {
window.alert('Ocorreu um erro ao criar a conta. Tente novamente mais tarde.', error.statusText)
}
}
</script>

5
app/pages/index.vue Normal file
View File

@@ -0,0 +1,5 @@
<template>
<div>
<h1>Welcome to the Home Page</h1>
</div>
</template>