feat: add internal endpoint to purge user session

This commit is contained in:
2026-02-19 14:16:12 +07:00
parent 959af8abdc
commit 7a3c46c6c1
4 changed files with 48 additions and 1 deletions

View File

@ -0,0 +1,18 @@
import { Context } from "elysia";
import { mainErrorHandler } from "../../../helpers/error/handler";
import { returnWriteResponse } from "../../../helpers/callback/httpResponse";
import { purgeUnusedSessionService } from "../services/http/purgeUnusedSession.service";
export const purgeUnusedSessionController = async (ctx: Context) => {
try {
const result = await purgeUnusedSessionService();
return returnWriteResponse(
ctx.set,
200,
"Successfully purged all unused user sessions",
result,
);
} catch (error) {
return mainErrorHandler(ctx.set, error);
}
};