<template>
  <div>GGZ</div>
</template>

<script>
export default {
  layout: `${process.env.CUSTOMER}Default`,
  components: {},
  async mounted () {
    const responsehash = this.$route.hash.split('&', 3);
	  const token = responsehash[0].replace('#access_token=', '');

    try {
        await this.$auth.loginWith('local', {
            data: {
                email: 'zzz@zzz.nl',
                password: 'zzzzzzzzz',
                token: token
            },
        })

        this.$router.push('/manager')
    } catch (error) {
        this.errors = error.response.data.errors
        this.$notifier.showMessage({
            content: error.response.data.message,
            color: 'error',
            icon: 'icon-message',
        })
        this.$router.push('/login')
    }

  }
}
</script>