<template>
  <change-password
    :email="email"
    :nonce="nonce"
    @passwordResetResponse="handlePasswordResetResponse"
  />
</template>

<script>
import ChangePassword from '~/components/PasswordReset/ChangePassword'

export default {
  data() {
    const { email = '', nonce = '' } = this.$route.query
    return { email, nonce }
  },
  components: {
    ChangePassword,
  },
  methods: {
    handlePasswordResetResponse(response) {
      if (response === 'success') {
        this.$router.push('/login')
      }
    },
  },
}
</script>
