Skip to content

Commit

Permalink
feat(premium): authenticate on boot
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroAkbal committed Jul 10, 2020
1 parent 184b0d2 commit 418a833
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
21 changes: 21 additions & 0 deletions components/pages/premium/PremiumCheckMixin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { mapState, mapActions } from 'vuex'

export default {
computed: {
...mapState('premium', ['gumroad']),
},

async mounted() {
if (!this.gumroad.product.license_key) {
console.debug('No license key, nothing to fetch')

return
}

await this.authenticate()
},

methods: {
...mapActions('premium', ['authenticate']),
},
}
3 changes: 3 additions & 0 deletions components/utils/StartUpMixin.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
import PremiumCheckMixin from '~/components/pages/premium/PremiumCheckMixin.js'

export default {
mixins: [PremiumCheckMixin],
}

0 comments on commit 418a833

Please sign in to comment.