Fairoj : Changes in interceptor
This commit is contained in:
parent
e0aa385bbc
commit
3d1e753539
@ -98,4 +98,4 @@
|
||||
"android"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -7,7 +7,7 @@ import { MyApp } from './app.component';
|
||||
|
||||
import { StatusBar } from '@ionic-native/status-bar';
|
||||
import { SplashScreen } from '@ionic-native/splash-screen';
|
||||
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
|
||||
// import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
|
||||
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
|
||||
import {
|
||||
MatAutocompleteModule,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { NumToWordsPipe } from './num-to-words/num-to-words';
|
||||
// import { NumToWordsPipe } from './num-to-words/num-to-words';
|
||||
@NgModule({
|
||||
declarations: [],
|
||||
imports: [],
|
||||
|
||||
@ -59,12 +59,12 @@ export class ReqTokenInterceptor implements HttpInterceptor{
|
||||
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpSentEvent | HttpHeaderResponse | HttpProgressEvent | HttpResponse<any> | HttpUserEvent<any>> {
|
||||
const cognitoService=this.injector.get(CognitoServiceProvider)
|
||||
|
||||
let token=cognitoService.getToken()
|
||||
let token=cognitoService.getToken() || ''
|
||||
console.log("Token From Interceptor >>",cognitoService.getToken())
|
||||
if(token!=''){
|
||||
token=token.getIdToken().getJwtToken()
|
||||
}
|
||||
return next.handle(this.addToken(req, token)).pipe(
|
||||
return <any>next.handle(this.addToken(req, token)).pipe(
|
||||
catchError(error => {
|
||||
if (error instanceof HttpErrorResponse) {
|
||||
if((<HttpErrorResponse>error).status) {
|
||||
|
||||
@ -3268,6 +3268,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
};
|
||||
|
||||
|
||||
// app-scripts v:3.2.4
|
||||
/*
|
||||
Generated class for the ConstantsProvider provider.
|
||||
|
||||
@ -3427,6 +3428,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
||||
|
||||
|
||||
|
||||
// import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
|
||||
|
||||
|
||||
|
||||
@ -4864,7 +4866,7 @@ var ReqTokenInterceptor = (function () {
|
||||
ReqTokenInterceptor.prototype.intercept = function (req, next) {
|
||||
var _this = this;
|
||||
var cognitoService = this.injector.get(__WEBPACK_IMPORTED_MODULE_4__aws_service_cognito_service__["a" /* CognitoServiceProvider */]);
|
||||
var token = cognitoService.getToken();
|
||||
var token = cognitoService.getToken() || '';
|
||||
console.log("Token From Interceptor >>", cognitoService.getToken());
|
||||
if (token != '') {
|
||||
token = token.getIdToken().getJwtToken();
|
||||
@ -4955,10 +4957,9 @@ var ReqTokenInterceptor = (function () {
|
||||
};
|
||||
ReqTokenInterceptor = __decorate([
|
||||
Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["B" /* Injectable */])(),
|
||||
__metadata("design:paramtypes", [typeof (_a = typeof __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Injector */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Injector */]) === "function" && _a || Object])
|
||||
__metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Injector */]])
|
||||
], ReqTokenInterceptor);
|
||||
return ReqTokenInterceptor;
|
||||
var _a;
|
||||
}());
|
||||
|
||||
//# sourceMappingURL=req-token.interceptor.js.map
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,6 +1,9 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" dir="ltr">
|
||||
<head>
|
||||
<script data-ionic="inject">
|
||||
(function(w){var i=w.Ionic=w.Ionic||{};i.version='3.9.2';i.angular='5.0.3';i.staticDir='build/';})(window);
|
||||
</script>
|
||||
<meta charset="UTF-8">
|
||||
<title>Ionic App</title>
|
||||
<meta name="viewport" content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user