Skip to content

Commit

Permalink
role typo fixed in middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
Mansibisen committed Jan 20, 2021
1 parent 8770c84 commit b26c3b4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/api/routers/AdminRoute.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Router.post(

await User.create({
emailId,
Role: "admin",
Role: "Admin",
password,
active: true,
});
Expand Down
10 changes: 5 additions & 5 deletions src/middlewares/role.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
const adminVerify = async (req, res, next) => {
if (req.jwt_payload.role !== "Admin" && req.jwt_payload.role !== "SuperAdmin")
if (req.jwt_payload.Role !== "Admin" && req.jwt_payload.Role !== "SuperAdmin")
return res.status(400).json({ message: "Access denied" });
return next();
};
const playerVerify = async (req, res, next) => {
if (
req.jwt_payload.role !== "Player" &&
req.jwt_payload.role !== "TeamMember" &&
req.jwt_payload.role !== "TeamLeader"
req.jwt_payload.Role !== "Player" &&
req.jwt_payload.Role !== "TeamMember" &&
req.jwt_payload.Role !== "TeamLeader"
)
return res.status(400).json({ message: "Access denied" });
return next();
};
const superAdminVerify = async (req, res, next) => {
if (req.jwt_payload.role !== "SuperAdmin")
if (req.jwt_payload.Role !== "SuperAdmin")
return res.status(400).json({ message: "Access denied" });
return next();
};
Expand Down

0 comments on commit b26c3b4

Please sign in to comment.