feat: integra autenticação do front com API real
- useAuth.ts: substitui mock por $fetch no /auth/login e /auth/logout - login.vue: adiciona campo "Organização" (slug) no formulário - nuxt.config.ts: adiciona runtimeConfig.public.apiBase Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -5,13 +5,14 @@ definePageMeta({ layout: 'auth' })
|
||||
const { login } = useAuth()
|
||||
const email = ref('')
|
||||
const password = ref('')
|
||||
const slug = ref('')
|
||||
const error = ref('')
|
||||
const loading = ref(false)
|
||||
|
||||
async function handleSubmit() {
|
||||
error.value = ''
|
||||
loading.value = true
|
||||
const result = await login(email.value, password.value)
|
||||
const result = await login(email.value, password.value, slug.value)
|
||||
loading.value = false
|
||||
if (result.success) {
|
||||
navigateTo('/')
|
||||
@@ -49,6 +50,16 @@ async function handleSubmit() {
|
||||
/>
|
||||
</UFormField>
|
||||
|
||||
<UFormField label="Organização" class="field">
|
||||
<UInput
|
||||
v-model="slug"
|
||||
type="text"
|
||||
placeholder="minha-empresa"
|
||||
size="md"
|
||||
required
|
||||
/>
|
||||
</UFormField>
|
||||
|
||||
<div class="forgot">
|
||||
<a href="#">Esqueceu a senha?</a>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user