The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/apps/meteor/app/cloud/server/functions/userLoggedOut.ts

22 lines
344 B

import { Users } from '@rocket.chat/models';
export async function userLoggedOut(userId: string) {
if (!userId) {
return false;
}
const user = await Users.findOneById(userId);
if (user?.services?.cloud) {
await Users.updateOne(
{ _id: user._id },
{
$unset: {
'services.cloud': 1,
},
},
);
}
return true;
}