When I refresh the page in Nuxt it throws error atob is not defined

406 Views Asked by At

When I navigate to the page through UI, page is rendering fine but when I do refresh the page, it throws the error Reference error atob is not defined.

here is my created function on same page .

created() {
if (typeof window !== 'undefined' && this.$route.query && this.$route.query.key) {
  this.formName = this.$route.query.formName
  this.isAuthorized = !!atob(this.$route.query.key).includes(this.formName)
  if (this.currentForm.isFormFilledUp === 1) {
    this.resetAll()
    this.termAcceptancePage = true
  }
}
 if (!this.isAuthorized) {
  this.$router.push('/')
 }
}
0

There are 0 best solutions below