UNPKG

los-auth

Version:

Libreria de autenticacion para las aplicaciones internas de la empresa LOS

26 lines 901 B
import { Injectable, Injector } from '@angular/core'; import { LosAuthService } from './los-auth.service'; var LosAuthInterceptor = /** @class */ (function () { function LosAuthInterceptor(injector) { this.injector = injector; } LosAuthInterceptor.prototype.intercept = function (request, next) { var auth = this.injector.get(LosAuthService); request = request.clone({ setHeaders: { Authorization: "Bearer " + auth.getToken() } }); return next.handle(request); }; LosAuthInterceptor.decorators = [ { type: Injectable }, ]; /** @nocollapse */ LosAuthInterceptor.ctorParameters = function () { return [ { type: Injector, }, ]; }; return LosAuthInterceptor; }()); export { LosAuthInterceptor }; //# sourceMappingURL=los-auth.interceptor.js.map