Ocelot-Social/webapp/pages/registration/create-user-account.vue
Robert Schäfer 29bbeaa0fa Fix tests by calling wrapper.html() once more
I really don't understand why, but apparently `wrapper.html()` does some
re-rendering which in our cases fixes the tests, because we reach the
new sub component in the DOM tree.
2019-07-09 22:12:40 +02:00

28 lines
680 B
Vue

<template>
<create-user-account @userCreated="handleUserCreated" :email="email" :nonce="nonce" />
</template>
<script>
import CreateUserAccount from '~/components/Registration/CreateUserAccount'
export default {
data() {
const { nonce = '', email = '' } = this.$route.query
return { nonce, email }
},
components: {
CreateUserAccount,
},
methods: {
async handleUserCreated({ email, password }) {
try {
await this.$store.dispatch('auth/login', { email, password })
this.$toast.success('You are logged in!')
this.$router.push('/')
} catch (err) {
this.$toast.error(err.message)
}
},
},
}
</script>