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