Skip to content

Create middleware to validate if user is part of Discord #2412

@surajmaity1

Description

@surajmaity1

Issue Description

Create a middleware to check if the user is part of Discord or not.

Current Behavior

We are checking in every controller if the user is part of Discord. Ideally, there should be a middleware that performs this check before reaching the controller.

Expected Behavior

A middleware should be implemented to verify whether the user is part of Discord. If the user is not part of Discord, the middleware should return a 403 Forbidden response, preventing any further operations. This middleware can be reused across routes that require this validation. It can be integrated into relevant route handlers to ensure that only authorized users who are members of Discord can access the protected resources or perform specific actions.

Screenshots

Reproducibility

  • This issue is reproducible
  • This issue is not reproducible

Steps to Reproduce

Severity/Priority

  • Critical
  • High
  • Medium
  • Low

Checklist

  • I have read and followed the project's code of conduct.
  • I have searched for similar issues before creating this one.
  • I have provided all the necessary information to understand and reproduce the issue.
  • I am willing to contribute to the resolution of this issue.

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