Skip to content

Update the identified routes to be protected with the relevant middleware #107

Description

@firepenguindisopanda

As a backend developer
I need to update the identified routes with the relevant middleware
So that only authorized users (students or admins) can access specific resources

Details and Assumptions

  • There are two middlewares: studentAccountVerification and adminAccountVerification.
  • Certain routes are intended only for students, while others are for admins.
  • Middleware should ensure only users with the correct role can access the route.
  • The application should handle unauthorized access with proper error responses (e.g., 401 or 403).
  • The routes needing middleware protection have already been identified.

Acceptance Criteria

Given a route that is intended for students
When the studentAccountVerification middleware is applied
Then only verified students can access the route and unauthorized users are blocked

Given a route that is intended for admins
When the adminAccountVerification middleware is applied
Then only verified admins can access the route and unauthorized users are blocked

Given a route that is intended for both students and admins
When the relevant middleware is applied
Then only users with the appropriate role can access the route

Given a protected route
When an unauthorized user attempts to access the route
Then the user should receive a 403 error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions