Skip to content
Snippets Groups Projects
Commit 4468ca54 authored by Guilherme Gazzo's avatar Guilherme Gazzo
Browse files

regression: notify user properly on logout (#32920)

parent d26eb5b1
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment