Skip to content

Commit a520a64

Browse files
make the api only for superuser
1 parent 24fb190 commit a520a64

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

routes/users.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ router.get("/:userId/intro", authenticate, authorizeRoles([SUPERUSER]), users.ge
2121
router.put("/self/intro", authenticate, userValidator.validateJoinData, users.addUserIntro);
2222
router.get("/:id/skills", users.getUserSkills);
2323
router.get("/:id/badges", getUserBadges);
24-
router.patch("/", authenticate, users.usersForInDiscord);
24+
router.patch("/", authenticate, authorizeRoles[SUPERUSER], users.usersForInDiscord);
2525

2626
// upload.single('profile') -> multer inmemory storage of file for type multipart/form-data
2727
router.post("/picture", authenticate, upload.single("profile"), users.postUserPicture);

test/integration/users.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1083,7 +1083,7 @@ describe("Users", function () {
10831083
chai
10841084
.request(app)
10851085
.patch("/users")
1086-
.set("Cookie", `${cookieName}=${jwt}`)
1086+
.set("Cookie", `${cookieName}=${superUserAuthToken}`)
10871087
.end((err, res) => {
10881088
if (err) {
10891089
return done(err);

0 commit comments

Comments
 (0)