🩹 back: when deleting user, only update non revoked sessions
This commit is contained in:
committed by
Anton Shepilov
parent
d2f4411112
commit
29c52e276b
@@ -332,10 +332,11 @@ export class ConsoleRemoteClient implements ConsoleServiceClient {
|
||||
const sessionRepository = gr.services.console.getSessionRepo();
|
||||
if (!sessionRepository) return;
|
||||
const sessions = (await sessionRepository.find({ sub: userId })).getEntities();
|
||||
for (const session of sessions) {
|
||||
session.revoked_at = new Date().getTime();
|
||||
await sessionRepository.save(session);
|
||||
}
|
||||
for (const session of sessions)
|
||||
if (!session.revoked_at) {
|
||||
session.revoked_at = new Date().getTime();
|
||||
await sessionRepository.save(session);
|
||||
}
|
||||
}
|
||||
|
||||
async verifyJwtSid(sid: string): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user