docs: function (req, res, next) {
    try {
      if (!req.body.email && !req.isAuthenticated()) {
        throw new Error('you must be logged in, to activate your account');
      }
      var userdata = CoreUtilities.removeEmptyObjectValues(req.body),
        salt = bcrypt.genSaltSync(10),
        expires = getTokenExpiresTime(),
        user_activation_token = encode({
          email: userdata.email || req.user.email,
        });
      userdata.attributes = {};
      userdata.attributes.user_activation_token = user_activation_token;
      userdata.attributes.user_activation_token_link = CoreUtilities.makeNiceName(bcrypt.hashSync(userdata.attributes.user_activation_token, salt));
      userdata.attributes.reset_activation_expires_millis = expires;
  
      req.body = userdata;
      next();
    }	catch (e) {
      CoreController.handleDocumentQueryErrorResponse({
        err: e,
        res: res,
        req: req,
        errorflash: e.message,
      });
    }
  }