unete only showed when user its not logged

This commit is contained in:
María
2025-09-15 14:38:12 +02:00
parent 5c4de25e9f
commit 6c5bd7f858

View File

@@ -1,7 +1,7 @@
<template>
<div class="container-fluid">
<FormHeader title="Registro de Cooperativa" />
<form class="form" @submit.prevent="userRegister">
<form v-if="!isAuthenticated" class="form" @submit.prevent="userRegister">
<FormInput
v-model="register.user.email"
required
@@ -64,6 +64,10 @@
<!-- {{ register }} -->
<SubmitButton text="registrar" image-url="" />
</form>
<p v-if="isAuthenticated" class="help" align="center">
Ya estás registrado y logueado. Ve al
<NuxtLink to="/"><b>inicio</b></NuxtLink> y explora la plataforma.
</p>
<!-- <p class="help" align="center">
*Para más información sobre este proyecto, visita la siguiente
<NuxtLink to="/page/info"><b>página</b></NuxtLink
@@ -73,6 +77,7 @@
</template>
<script>
import { useAuthStore } from '@/stores/auth'
import dataProcessing from '~/utils/dataProcessing'
export default {
// setup() {
@@ -80,6 +85,12 @@ export default {
// layout: 'main',
// })
// },
setup() {
const auth = useAuthStore();
return {
auth,
}
},
data() {
return {
register: {
@@ -105,6 +116,9 @@ export default {
}
},
computed: {
isAuthenticated() {
return this.auth.isAuthenticated
},
isValidForm() {
if (
this.register.user.email &&
@@ -118,6 +132,9 @@ export default {
}
return false
},
userIsLogged() {
return this.auth.access
},
},
methods: {
isValidUrl: dataProcessing.isValidUrl,
@@ -155,9 +172,9 @@ export default {
</script>
<style lang="scss" scoped>
.container-fluid {
margin-top: 5rem;
margin-bottom: 5rem;
width: 100%;
min-height: 60dvh;
display: flex;
flex-direction: column;
align-items: center;
@@ -204,11 +221,20 @@ export default {
}
.help {
color: $color-navy;
color: $color-primary;
// margin-bottom: 80px;
font-size: $m;
@include mobile {
font-size: $s;
}
a {
text-decoration: none;
color: $color-button;
text-transform: uppercase;
&:hover {
text-decoration: underline;
cursor: pointer;
}
}
}
</style>