SpaceNinjaServer/src/controllers/api/deleteSessionController.ts
VoltPrime 4d93dc80dc
Some checks failed
Build Docker image / docker (push) Waiting to run
Build / build (push) Has been cancelled
fix: creating/deleting sessions in pre-Specters of the Rail builds (#2978)
This is only verified to work as far back as U15, I have not tried to test any builds older than that yet until they are added to the support list.

Reviewed-on: #2978
Reviewed-by: Sainan <63328889+sainan@users.noreply.github.com>
Co-authored-by: VoltPrime <subsonicjackal@gmail.com>
Co-committed-by: VoltPrime <subsonicjackal@gmail.com>
2025-11-02 23:28:10 -08:00

18 lines
759 B
TypeScript

import type { RequestHandler } from "express";
import { deleteSession } from "../../managers/sessionManager.ts";
import { getAccountForRequest } from "../../services/loginService.ts";
import { version_compare } from "../../helpers/inventoryHelpers.ts";
const deleteSessionController: RequestHandler = async (_req, res) => {
const account = await getAccountForRequest(_req);
deleteSession(_req.query.sessionId as string);
if (account.BuildLabel && version_compare(account.BuildLabel, "2016.07.08.16.56") < 0) {
// Pre-Specters of the Rail
res.send(_req.query.sessionId as string); // Unsure if this is correct, but the client is chill with it
} else {
res.sendStatus(200);
}
};
export { deleteSessionController };