返回提交历史
Modified
src/controllers/api/creditsController.ts
+6
-0
XFEstudio/XFESpaceNinjaServer
chore: gracefully handle credits request without credentials (#3869)
Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/3869 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
71ed719c
代码差异
1 个文件
+6
-0
@@ -3,6 +3,12 @@ import { getAccountIdForRequest } from "../../services/loginService.ts";
3
3
import { getInventory } from "../../services/inventoryService.ts";
4
4
5
5
export const creditsController: RequestHandler = async (req, res) => {
6
// U9 and below are known to sometimes send this request without credentials, so just handle it more gracefully.
7
if (!req.query.accountId) {
8
res.sendStatus(400);
9
return;
10
}
11
6
12
const inventory = (
7
13
await Promise.all([
8
14
getAccountIdForRequest(req),