bitcitawebfront-library
Version:
Angular CLI project used by other Angular projects in the bitcita web project.<br />
47 lines • 2.83 kB
JavaScript
;
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
var core_1 = require("@angular/core");
var rxjs_1 = require("rxjs");
var operators_1 = require("rxjs/operators");
var http_utils_service_1 = require("../../shared/service/http-utils.service");
var token_interceptor_1 = require("../interceptor/token.interceptor");
var i0 = require("@angular/core");
var i1 = require("../../shared/service/http-utils.service");
var CaptchaService = /** @class */ (function () {
function CaptchaService(http) {
this.http = http;
this.baseUrlCaptcha = "v1/captcha";
console.log("CaptchaService construido");
}
// OPERACIONES CON EL SERVIDOR
CaptchaService.prototype.validacionMock = function (captcha) {
var jwt = "eyJhbGciOiJIUzUxMiJ9.eyJpc3MiOiJJQi1TQUxVVCIsImlhdCI6MTYyMDk5Nzg0OSwiZXhwIjozNzgwOTk3ODQ5LCJqdGkiOiIxZTYyYTVhNy0xYzJjLTQyNzktOGIwNS05MThmOTVkMTE4NDQifQ.dTINP86PR5hAEpw-1T469RkA_XQrEG934xKKubpRJ1cNqDrkBpkXnYOzWa5MjScPAYMIcWBDFINWvzOX-EJEOQ";
token_interceptor_1.TokenInterceptor.setToken(jwt);
return rxjs_1.of(true);
};
CaptchaService.prototype.validacion = function (captcha) {
var url = this.baseUrlCaptcha + "/validacion?captcha=" + captcha;
return this.http.getHttpGet(url).pipe(operators_1.tap(function (response) {
token_interceptor_1.TokenInterceptor.setToken(response.jwt);
}), operators_1.map(function (response) { return response.valido; }));
};
CaptchaService.ngInjectableDef = i0.ɵɵdefineInjectable({ factory: function CaptchaService_Factory() { return new CaptchaService(i0.ɵɵinject(i1.HttpUtilsService)); }, token: CaptchaService, providedIn: "root" });
CaptchaService = __decorate([
core_1.Injectable({
providedIn: "root"
}),
__metadata("design:paramtypes", [http_utils_service_1.HttpUtilsService])
], CaptchaService);
return CaptchaService;
}());
exports.CaptchaService = CaptchaService;
//# sourceMappingURL=captcha.service.js.map