whole_func_string: function registerBasicAuth(app, authConfig) {
      if (typeof authConfig.user !== 'string' || typeof authConfig.password !== 'string') return;
      app.use((req, res, next) => {
        let credentials = basicAuth(req);
        if (!credentials || credentials.name !== authConfig.user || credentials.pass !== authConfig.password) {
          res.setHeader('WWW-Authenticate', `Basic realm="${config.realm || 'app'}"`);
          return next(thorin.error('UNAUTHORIZED', 'Authorization failed', 401));
        }
        next();
      });
    }
func_code_string: function registerBasicAuth(app, authConfig) {
      if (typeof authConfig.user !== 'string' || typeof authConfig.password !== 'string') return;
      app.use((req, res, next) => {
        let credentials = basicAuth(req);
        if (!credentials || credentials.name !== authConfig.user || credentials.pass !== authConfig.password) {
          res.setHeader('WWW-Authenticate', `Basic realm="${config.realm || 'app'}"`);
          return next(thorin.error('UNAUTHORIZED', 'Authorization failed', 401));
        }
        next();
      });
    }
func_documentation_string: /*
  Registers basic authorization