server/services/authService.js
// Activates the account of a user specified by the token
Activates the account of a user specified by the token
Activates the account of a user specified by the token
static activate(token) {
    return AuthService.findUserByToken(token, false)
      .then((user) => { 
        return User.find({ email: user.email, active: true }).then((users) => {
          if (users && users.length > 0) {
            return Promise.reject();
          }
          user.active = true;
          return user.save();
        });
      });
  }
static activate ( token ) { return AuthService . findUserByToken ( token , false ) . then ( ( user ) => { return User . find ( { email : user . email , active : true } ) . then ( ( users ) => { if ( users && users . length > 0 ) { return Promise . reject ( ) ; } user . active = true ; return user . save ( ) ; } ) ; } ) ; }
Activates the account of a user specified by the token
Activates the account of a user specified by the token
// eslint-disable-line arrow-body-style // Make sure that there isn't already an active account with the email