Skip to content

Commit 29c52e2

Browse files
ericlinagorashepilov
authored andcommitted
🩹 back: when deleting user, only update non revoked sessions
1 parent d2f4411 commit 29c52e2

File tree

1 file changed

+5
-4
lines changed
  • tdrive/backend/node/src/services/console/clients

1 file changed

+5
-4
lines changed

‎tdrive/backend/node/src/services/console/clients/remote.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -332,10 +332,11 @@ export class ConsoleRemoteClient implements ConsoleServiceClient {
332332
const sessionRepository = gr.services.console.getSessionRepo();
333333
if (!sessionRepository) return;
334334
const sessions = (await sessionRepository.find({ sub: userId })).getEntities();
335-
for (const session of sessions) {
336-
session.revoked_at = new Date().getTime();
337-
await sessionRepository.save(session);
338-
}
335+
for (const session of sessions)
336+
if (!session.revoked_at) {
337+
session.revoked_at = new Date().getTime();
338+
await sessionRepository.save(session);
339+
}
339340
}
340341

341342
async verifyJwtSid(sid: string): Promise<void> {

0 commit comments

Comments
 (0)