mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
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.
28 lines
680 B
Vue
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>
|