misc: fixed log clipping and added idempotency to session end

This commit is contained in:
Sheen Capadngan
2025-10-03 21:51:22 +08:00
parent 6a7d84f052
commit 5f4735926c
3 changed files with 19 additions and 5 deletions

View File

@@ -152,6 +152,13 @@ export const pamSessionServiceFactory = ({
OrgPermissionSubjects.Gateway
);
if (session.status === PamSessionStatus.Ended) {
return {
session,
projectId: project.id
};
}
if (session.status !== PamSessionStatus.Active) {
throw new BadRequestError({ message: "Cannot end sessions that are not active" });
}