RealDevSquad / RealDevSquad/website-backend

suggestion to change in authorizeUser middleware flow

Open
#576 1 comment 1 reaction 1 assignee View on GitHub

@pallabez is already working on this.

Since Apr 23, 2022.

bug
Dominant language
JavaScript
Stars
74
Forks
276
Avg merge
1d 26m
Merged PRs (30d)
14

Description

authorizeUser middleware is currently used for setting up the role needed to consume that API.

eg - authorizeUser("appOwner") sets it up so that only appOwner or above(superUser) can access the API.

But if we accidentally pass the wrong argument, let's say authorizeUser("app_owner"), it uses the current default state of authorizeUser. i e. anyone can use this API. Which can be harmful.

I'd suggest to change the default state of authorizeUser to be restricted so that no roles can use this API and we catch it early on.

Estimated time to complete - 30 min 

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.