🩹 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();
|
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)
|
||||||
session.revoked_at = new Date().getTime();
|
if (!session.revoked_at) {
|
||||||
await sessionRepository.save(session);
|
session.revoked_at = new Date().getTime();
|
||||||
}
|
await sessionRepository.save(session);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async verifyJwtSid(sid: string): Promise<void> {
|
async verifyJwtSid(sid: string): Promise<void> {
|
||||||
|
|||||||
Reference in New Issue
Block a user