Skip to content
Snippets Groups Projects
Unverified Commit f25081bc authored by Pierre Lehnen's avatar Pierre Lehnen Committed by Diego Sampaio
Browse files

[FIX] Never-used imported accounts can be accessed without proper authentication. (#670)

parent a56f5f0a
No related branches found
No related tags found
No related merge requests found
---
'@rocket.chat/meteor': patch
---
Removed an unused authentication flow
......@@ -95,15 +95,7 @@ Meteor.methods<ServerMethods>({
let userId;
try {
// Check if user has already been imported and never logged in. If so, set password and let it through
const importedUser = await Users.findOneByEmailAddress(formData.email);
if (importedUser?.importIds?.length && !importedUser.lastLogin) {
await Accounts.setPasswordAsync(importedUser._id, userData.password);
userId = importedUser._id;
} else {
userId = await Accounts.createUserAsync(userData);
}
userId = await Accounts.createUserAsync(userData);
} catch (e) {
if (e instanceof Meteor.Error) {
throw e;
......
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