Commit 1c9a3a35 authored by void's avatar void
Browse files

hacer redirect en CrearCuenta

parent cddeeeaf
<template>
<div class="container">
<h1>Creando cuenta...</h1>
<p v-if="redirect">necesitas iniciar sesión para ir acá :)</p>
<custom-form
:fields="fields"
:handleSubmit="handleSubmit"
......@@ -38,11 +39,16 @@ export default {
components: {
CustomForm,
},
computed: {
redirect() {
return this.$route.query.redirect
},
},
methods: {
handleSubmit(userData) {
return this.$store
.dispatch('crearCuenta', userData)
.then(res => this.$router.replace('/'))
.then(res => this.$router.replace(this.redirect || '/'))
},
parseError: error => error, // probablemente no pase ningun error generico
},
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment