RealDevSquad / RealDevSquad/website-backend
Create middleware to validate if user is part of Discord
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 74
- Forks
- 276
- Avg merge
- 1d 26m
- Merged PRs (30d)
- 14
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the controller checks for Discord membership and the route handlers that need shared validation. Confirm the existing membership check and its failure behavior; done means a reusable middleware is applied to the relevant routes, returns 403 for non-members, and prevents controller work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs
- Domain
- api, authorization, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100