🩹 back: when deleting user, only update non revoked sessions

This commit is contained in:
Eric Doughty-Papassideris
2025-03-11 13:28:01 +01:00
committed by Anton Shepilov
parent d2f4411112
commit 29c52e276b
@@ -332,7 +332,8 @@ export class ConsoleRemoteClient implements ConsoleServiceClient {
const sessionRepository = gr.services.console.getSessionRepo(); const sessionRepository = gr.services.console.getSessionRepo();
if (!sessionRepository) return; if (!sessionRepository) return;
const sessions = (await sessionRepository.find({ sub: userId })).getEntities(); const sessions = (await sessionRepository.find({ sub: userId })).getEntities();
for (const session of sessions) { for (const session of sessions)
if (!session.revoked_at) {
session.revoked_at = new Date().getTime(); session.revoked_at = new Date().getTime();
await sessionRepository.save(session); await sessionRepository.save(session);
} }