<reponame>LsDri92/portfolio-angular
{"ast":null,"code":"import * as i0 from \"@angular/core\";\nimport * as i1 from \"./autenticacion.service\";\nexport let InterceptorService = /*#__PURE__*/(() => {\n  class InterceptorService {\n    constructor(autenticacionServicio) {\n      this.autenticacionServicio = autenticacionServicio;\n    }\n\n    intercept(req, next) {\n      var currentUser = this.autenticacionServicio.UsuarioAutenticado;\n\n      if (currentUser && currentUser.accessToken) {\n        req = req.clone({\n          setHeaders: {\n            Authorization: `Bearer ${currentUser.accessToken}`\n          }\n        });\n      }\n\n      console.log(\"Interceptor está corriendo\" + JSON.stringify(currentUser));\n      return next.handle(req);\n    }\n\n  }\n\n  InterceptorService.ɵfac = function InterceptorService_Factory(t) {\n    return new (t || InterceptorService)(i0.ɵɵinject(i1.AutenticacionService));\n  };\n\n  InterceptorService.ɵprov = /*@__PURE__*/i0.ɵɵdefineInjectable({\n    token: InterceptorService,\n    factory: InterceptorService.ɵfac,\n    providedIn: 'root'\n  });\n  return InterceptorService;\n})();","map":null,"metadata":{},"sourceType":"module"}