generators/app/templates/server/lib/auth(auth)/auth.service.js
function addAuthContext(namespace) {
  if (!namespace) {
    throw new Error('No context namespace specified!');
  }

  return function addAuthContextMiddleWare(req, res, next) {
    contextService.setContext(namespace, req.userInfo);
    next();
  };
}
function addAuthContext(namespace) {
  if (!namespace) {
    throw new Error('No context namespace specified!');
  }

  return function addAuthContextMiddleWare(req, res, next) {
    contextService.setContext(namespace, req.userInfo);
    next();
  };
}
function addAuthContext ( namespace ) { if ( ! namespace ) { throw new Error ( 'No context namespace specified!' ) ; } return function addAuthContextMiddleWare ( req , res , next ) { contextService . setContext ( namespace , req . userInfo ) ; next ( ) ; } ; }
Add the current user object to the request context as the given name

@param {http.IncomingMessage} req - The request message object
@param {ServerResponse} res - The outgoing response object
@param {function} next - The next handler callback
Add the current user object to the request context as the given name