fix rate-limit.js module failing to block excessive requests
This commit is contained in:
parent
6bfe6a3947
commit
031f36759f
2 changed files with 5 additions and 11 deletions
|
|
@ -1,4 +1,5 @@
|
|||
/* eslint-disable consistent-return */
|
||||
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { Accounts } from 'meteor/accounts-base';
|
||||
|
||||
|
|
@ -6,6 +7,7 @@ let action;
|
|||
|
||||
const updatePassword = (userId, newPassword) => {
|
||||
try {
|
||||
throw new Meteor.Error('500', 'Testing failures.');
|
||||
Accounts.setPassword(userId, newPassword, { logout: false });
|
||||
} catch (exception) {
|
||||
action.reject(`[editProfile.updatePassword] ${exception}`);
|
||||
|
|
@ -31,13 +33,12 @@ const editProfile = ({ userId, profile }, promise) => {
|
|||
|
||||
updateUser(userId, profile);
|
||||
if (profile.password) updatePassword(userId, profile.password);
|
||||
|
||||
action.resolve();
|
||||
} catch (exception) {
|
||||
action.reject(`[editProfile.handler] ${exception}`);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
export default options =>
|
||||
new Promise((resolve, reject) =>
|
||||
editProfile(options, { resolve, reject }));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue