Applied style rules to genocide all \t characters

This commit is contained in:
Stefan Zermatten
2022-10-09 16:01:36 +02:00
parent de598c70a7
commit 2fa913b09a
208 changed files with 6027 additions and 5801 deletions

View File

@@ -3,8 +3,8 @@ import { ValidatedMethod } from 'meteor/mdg:validated-method';
import { RateLimiterMixin } from 'ddp-rate-limiter-mixin';
const addEmail = new ValidatedMethod({
name: 'users.addEmail',
validate: new SimpleSchema({
name: 'users.addEmail',
validate: new SimpleSchema({
email: {
type: String,
regEx: SimpleSchema.RegEx.Email,
@@ -15,20 +15,20 @@ const addEmail = new ValidatedMethod({
numRequests: 1,
timeInterval: 5000,
},
run({email}){
run({ email }) {
const userId = Meteor.userId();
const user = Meteor.users.findOne(userId);
if (!user) throw new Meteor.Error('No user',
'You must be logged in to add an email address');
if (user.emails && user.emails.length >= 2){
'You must be logged in to add an email address');
if (user.emails && user.emails.length >= 2) {
throw new Meteor.Error('Emails full',
'You may only have up to 2 email addresses per account');
'You may only have up to 2 email addresses per account');
}
if (Meteor.isServer){
if (Meteor.isServer) {
Accounts.addEmail(userId, email);
Accounts.sendVerificationEmail(userId, email);
}
}
}
});
export default addEmail;