- is-auth middleware adds userId, name and email in req. It gets these details from jwtToken.
- get-role middleware uses userId from req and gets courseId from query (GET) or body (POST) depending on the method used. It adds role (req.role) and courserId (req.courseId). It can also be used to check whether an user is enrolled in the course or not.
- is-Instructor checks whether the user is instructor in course or not.
- is-not-student checks whether the user is instructor or not.