summaryrefslogtreecommitdiff
path: root/packages/backend/src/server/web/ClientServerService.ts
diff options
context:
space:
mode:
authorMomentQYC <62551256+MomentQYC@users.noreply.github.com>2023-08-21 16:21:57 +0800
committerGitHub <noreply@github.com>2023-08-21 17:21:57 +0900
commit388448f29823194a7e807c63df379321dfcbd0a2 (patch)
treec5c79de1f665c29a15a8833b2c7dba76b10678b1 /packages/backend/src/server/web/ClientServerService.ts
parentfeat: 'server' webhook payload which hold misskey server url (#11752) (diff)
downloadsharkey-388448f29823194a7e807c63df379321dfcbd0a2.tar.gz
sharkey-388448f29823194a7e807c63df379321dfcbd0a2.tar.bz2
sharkey-388448f29823194a7e807c63df379321dfcbd0a2.zip
feat: Removing stack trace info in production env (#11657)
* feat: Hiding stack traces in production env * sytle * style * style * add SPDX * move ./error.js to ./misc/error.js * revert: remove frontend changes * feat: Hiding stack traces in production env * feat: Hiding stack traces in production env * revert * revert * revert * change and fix * revert * fix queue endpoint test --------- Co-authored-by: tamaina <tamaina@hotmail.co.jp> Co-authored-by: Kagami Sascha Rosylight <saschanaz@outlook.com>
Diffstat (limited to 'packages/backend/src/server/web/ClientServerService.ts')
-rw-r--r--packages/backend/src/server/web/ClientServerService.ts12
1 files changed, 6 insertions, 6 deletions
diff --git a/packages/backend/src/server/web/ClientServerService.ts b/packages/backend/src/server/web/ClientServerService.ts
index 25f59914ff..56aa343632 100644
--- a/packages/backend/src/server/web/ClientServerService.ts
+++ b/packages/backend/src/server/web/ClientServerService.ts
@@ -148,18 +148,18 @@ export class ClientServerService {
if (url === bullBoardPath || url.startsWith(bullBoardPath + '/')) {
const token = request.cookies.token;
if (token == null) {
- reply.code(401);
- throw new Error('login required');
+ reply.code(401).send('Login required');
+ return;
}
const user = await this.usersRepository.findOneBy({ token });
if (user == null) {
- reply.code(403);
- throw new Error('no such user');
+ reply.code(403).send('No such user');
+ return;
}
const isAdministrator = await this.roleService.isAdministrator(user);
if (!isAdministrator) {
- reply.code(403);
- throw new Error('access denied');
+ reply.code(403).send('Access denied');
+ return;
}
}
});