<template>
  <div>
    Tutorial Content
  </div>
</template>
<script>
import { mapGetters } from 'vuex'
import { DASHBOARD_HOME } from '@/config/url-prefix'
import { API_TOKEN } from '@/store/utils/localStorageKeys'

export default {
  name: 'Tutorial',
  beforeRouteEnter(to, from, next) {
    let path = from.path
    next(vm => {
      vm.previousRoute = path
    })
  },
  components: {},
  data() {
    return {
      previousRoute: DASHBOARD_HOME,
    }
  },
  mounted() {
    let link = this.getTutorialLoginUrl + '/?access_type=Bearer&access_token=' + localStorage.getItem(API_TOKEN)
    window.open(link, '_blank')
    this.$router.replace(this.previousRoute)
  },
  methods: {},
  computed: {
    ...mapGetters(['getTutorialLoginUrl']),
  },
}
</script>
