message: Make code more concise and DRY
diff: @@ -36,16 +36,16 @@ const decodeToken = (
  }
  };
  -const notEmpty = R.compose(
  +const notEmptyOrNaN /* : Function */ = R.allPass([
  + R.compose(
  R.not,
  R.isEmpty,
  -);
  -const notNaN = R.compose(
  + ),
  + R.compose(
  R.not,
  R.equals(NaN),
  -);
  -
  -const notEmptyOrNaN /* : Function */ = R.allPass([notEmpty, notNaN]);
  + ),
  +]);
  // Input: Comma-separated string with ids (defaults to '' if null)
  // Output: Array of ids (as strings again..)
  @@ -93,16 +93,10 @@ type CreateAuthMiddlewareFn =
  */
  -const createAuthMiddleware /* : CreateAuthMiddlewareFn */ = args => async (
  - req,
  - res,
  - next,
  -) => {
  - const {
  - // baseUri,
  +const createAuthMiddleware /* : CreateAuthMiddlewareFn */ = ({
  jwtSecret,
  jwtAudience,
  - } = args;
  +}) => async (req, res, next) => {
  const ctx = req.app.get('context');
  const dao = ctx.dao;
  @@ -126,11 +120,12 @@ const createAuthMiddleware /* : CreateAuthMiddlewareFn */ = args => async (
  try {
  decoded = decodeToken(token, jwtSecret);
  } catch (e) {
  - logger.debug(`Error while decoding auth token: ${e.message}`);
  + const errorMessage = `Error while decoding auth token: ${e.message}`;
  + logger.debug(errorMessage);
  res.status(500).send({
  errors: [
  {
  - message: `Error while decoding auth token: ${e.message}`,
  + message: errorMessage,
  },
  ],
  });
  