Skip to content

Commit

Permalink
Revert "Allow bot authentication for emoji management routes"
Browse files Browse the repository at this point in the history
This reverts commit d513231.
  • Loading branch information
SupertigerDev committed Jan 15, 2025
1 parent d513231 commit de9ca20
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/routes/servers/serverEmojiAdd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { verifyUpload } from '../../common/nerimityCDN';
export function serverEmojiAdd(Router: Router) {
Router.post(
'/servers/:serverId/emojis',
authenticate({allowBot: true}),
authenticate(),
serverMemberVerification(),
memberHasRolePermissionMiddleware(ROLE_PERMISSIONS.ADMIN),
body('name')
Expand Down
2 changes: 1 addition & 1 deletion src/routes/servers/serverEmojiUpdate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { addServerEmoji, updateServerEmoji } from '../../services/Server';

export function serverEmojiUpdate(Router: Router) {
Router.post('/servers/:serverId/emojis/:id',
authenticate({allowBot: true}),
authenticate(),
serverMemberVerification(),
memberHasRolePermissionMiddleware(ROLE_PERMISSIONS.ADMIN),
body('name')
Expand Down
2 changes: 1 addition & 1 deletion src/routes/servers/serverEmojisDelete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { deleteServerEmoji, getServerEmojis } from '../../services/Server';

export function serverEmojiDelete(Router: Router) {
Router.delete('/servers/:serverId/emojis/:id',
authenticate({allowBot: true}),
authenticate(),
serverMemberVerification(),
memberHasRolePermissionMiddleware(ROLE_PERMISSIONS.ADMIN),
rateLimit({
Expand Down
9 changes: 5 additions & 4 deletions src/routes/servers/serverEmojisGet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ import { serverMemberVerification } from '../../middleware/serverMemberVerificat
import { getServerEmojis } from '../../services/Server';

export function serverEmojisGet(Router: Router) {
Router.get(
'/servers/:serverId/emojis',
authenticate({ allowBot: true }),
Router.get('/servers/:serverId/emojis',
authenticate(),
serverMemberVerification(),
memberHasRolePermissionMiddleware(ROLE_PERMISSIONS.ADMIN),
rateLimit({
Expand All @@ -23,10 +22,12 @@ export function serverEmojisGet(Router: Router) {
);
}



async function route(req: Request, res: Response) {
const [updated, error] = await getServerEmojis(req.serverCache.id);
if (error) {
return res.status(400).json(error);
}
res.json(updated);
}
}

0 comments on commit de9ca20

Please sign in to comment.