regression: notify user properly on logout (#32920)

pull/32908/head^2
Guilherme Gazzo 1 year ago committed by GitHub
parent 776fc1e536
commit b55869bf74
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      apps/meteor/app/api/server/v1/users.ts
  2. 3
      apps/meteor/server/lib/resetUserE2EKey.ts

@ -1216,7 +1216,7 @@ API.v1.addRoute(
throw new Meteor.Error('error-invalid-user-id', 'Invalid user id');
}
void notifyOnUserChange({ clientAction: 'updated', id: this.userId, diff: { 'services.resume.loginTokens': [] } });
void notifyOnUserChange({ clientAction: 'updated', id: userId, diff: { 'services.resume.loginTokens': [] } });
return API.v1.success({
message: `User ${userId} has been logged out!`,

@ -2,6 +2,7 @@ import { api } from '@rocket.chat/core-services';
import { Subscriptions, Users, Rooms } from '@rocket.chat/models';
import { Meteor } from 'meteor/meteor';
import { notifyOnUserChange } from '../../app/lib/server/lib/notifyListener';
import * as Mailer from '../../app/mailer/server/api';
import { settings } from '../../app/settings/server';
import { i18n } from './i18n';
@ -76,5 +77,7 @@ export async function resetUserE2EEncriptionKey(uid: string, notifyUser: boolean
// Force the user to logout, so that the keys can be generated again
await Users.unsetLoginTokens(uid);
void notifyOnUserChange({ clientAction: 'updated', id: uid, diff: { 'services.resume.loginTokens': [] } });
return true;
}

Loading…
Cancel
Save