feat: add logout endpoint
Some checks failed
Integration Tests / integration-tests (pull_request) Failing after 51s

This commit is contained in:
2026-02-13 19:46:44 +07:00
parent 588ac49e01
commit 42aa7ed8d3
3 changed files with 26 additions and 1 deletions

View File

@ -0,0 +1,18 @@
import { AppError } from "../../../helpers/error/instances/app";
import { prisma } from "../../../utils/databases/prisma/connection";
export const deleteUserSessionRepository = async (sessionId: string) => {
try {
return await prisma.userSession.update({
where: {
id: sessionId,
},
data: {
isAuthenticated: false,
deletedAt: new Date(),
},
});
} catch (error) {
throw new AppError(500, "Failed to delete user session", error);
}
};