In this lesson, we update our middleware to only allow access to the course if it’s been paid for.
We first create a hasAccess endpoint that looks for the CoursePurchase object. If it exists, the user is allowed access.
Then we update our route middleware and server middleware to use this new endpoint to control access.
In our route middleware, we also have to handle the case where the user logs in with Github but hasn’t purchased the course. Instead of letting them get into this weird state, we’ll immediately log them out instead.
18 lessons
7 lessons
7 lessons
11 lessons
18 lessons
8 lessons
17 lessons