mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-07-07 20:44:34 +00:00
added cleanup to more sections
This commit is contained in:
parent
e40f3917f3
commit
b218251b94
1 changed files with 3 additions and 0 deletions
|
@ -213,6 +213,7 @@ export class ApiCallService implements OnApplicationShutdown {
|
|||
? request.headers.authorization.slice(7)
|
||||
: fields['i'];
|
||||
if (token != null && typeof token !== 'string') {
|
||||
cleanup();
|
||||
reply.code(400);
|
||||
return;
|
||||
}
|
||||
|
@ -223,6 +224,7 @@ export class ApiCallService implements OnApplicationShutdown {
|
|||
}, request, reply).then((res) => {
|
||||
this.send(reply, res);
|
||||
}).catch((err: ApiError) => {
|
||||
cleanup();
|
||||
this.#sendApiError(reply, err);
|
||||
});
|
||||
|
||||
|
@ -230,6 +232,7 @@ export class ApiCallService implements OnApplicationShutdown {
|
|||
this.logIp(request, user);
|
||||
}
|
||||
}).catch(err => {
|
||||
cleanup();
|
||||
this.#sendAuthenticationError(reply, err);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue