summaryrefslogtreecommitdiff
path: root/packages/backend/src/server/api/ApiCallService.ts
diff options
context:
space:
mode:
authortamaina <tamaina@hotmail.co.jp>2023-03-09 14:27:16 +0900
committerGitHub <noreply@github.com>2023-03-09 14:27:16 +0900
commitc75afad64aba2f4cce3f7fc37a66e9dc45488383 (patch)
tree96dcfab25705393119b2ea60329fb3f59f77aa73 /packages/backend/src/server/api/ApiCallService.ts
parentfix: 登録メール送信時に重複確認を行う (#10231) (diff)
downloadsharkey-c75afad64aba2f4cce3f7fc37a66e9dc45488383.tar.gz
sharkey-c75afad64aba2f4cce3f7fc37a66e9dc45488383.tar.bz2
sharkey-c75afad64aba2f4cce3f7fc37a66e9dc45488383.zip
enhance: アカウント削除時のクライアントの挙動をいい感じにするなど (#10002)
* refreshAccounts Resolve #9322 * アカウント管理画面でリストを更新するように * Update packages/frontend/src/account.ts Co-authored-by: Acid Chicken (硫酸鶏) <root@acid-chicken.com> * :v: * クライアント起動時は現在ログインしているアカウントのみリフレッシュする * clean up * なんかめっちゃ変えた * refactor * refactor * fix lint --------- Co-authored-by: Acid Chicken (硫酸鶏) <root@acid-chicken.com>
Diffstat (limited to 'packages/backend/src/server/api/ApiCallService.ts')
-rw-r--r--packages/backend/src/server/api/ApiCallService.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/packages/backend/src/server/api/ApiCallService.ts b/packages/backend/src/server/api/ApiCallService.ts
index f84a3aa59b..bf5cb20918 100644
--- a/packages/backend/src/server/api/ApiCallService.ts
+++ b/packages/backend/src/server/api/ApiCallService.ts
@@ -75,7 +75,7 @@ export class ApiCallService implements OnApplicationShutdown {
}
this.send(reply, res);
}).catch((err: ApiError) => {
- this.send(reply, err.httpStatusCode ? err.httpStatusCode : err.kind === 'client' ? 400 : 500, err);
+ this.send(reply, err.httpStatusCode ? err.httpStatusCode : err.kind === 'client' ? 400 : err.kind === 'permission' ? 403 : 500, err);
});
if (user) {
@@ -129,7 +129,7 @@ export class ApiCallService implements OnApplicationShutdown {
}, request).then((res) => {
this.send(reply, res);
}).catch((err: ApiError) => {
- this.send(reply, err.httpStatusCode ? err.httpStatusCode : err.kind === 'client' ? 400 : 500, err);
+ this.send(reply, err.httpStatusCode ? err.httpStatusCode : err.kind === 'client' ? 400 : err.kind === 'permission' ? 403 : 500, err);
});
if (user) {
@@ -321,7 +321,7 @@ export class ApiCallService implements OnApplicationShutdown {
// API invoking
return await ep.exec(data, user, token, file, request.ip, request.headers).catch((err: Error) => {
- if (err instanceof ApiError) {
+ if (err instanceof ApiError || err instanceof AuthenticationError) {
throw err;
} else {
const errId = uuid();