Join our community

Get access to the complete guide to developing and deploying fast, production-ready Nuxt apps.

7-10 Overview of Granting Access

In this lesson, we’ll go over how we’ll grant access to our online course.

We have two problems to solve:

  1. Securely verifying the purchase through the backend
  2. Linking the user’s Github account with the purchase

We’ll solve this using a CoursePurchase object:

  1. Create the CoursePurchase when we create the PaymentIntent
  2. Wait for Stripe’s webhook to verify the purchase was successful
  3. Redirect the user to login, so we can link their Github with the CoursePurchase account

To grant access, we then look up this CoursePurchase object in our middleware to verify the user has paid for the course.