{"version":3,"sources":["$_lazy_route_resources|lazy|groupOptions: {}|namespace object","src/app/app.config.ts","src/app/guards/public-route.guard.ts","src/app/guards/role.guard.ts","src/app/material.module.ts","src/app/models/enums/role-definition.enum.ts","src/app/models/jwt-container.model.ts","src/app/services/storage.service.ts","src/app/services/auth.service.ts","src/app/services/spinner.service.ts","src/environments/environment.ts","src/app/components/not-found/not-found.component.ts","src/app/components/not-found/not-found.component.html","src/app/app-routing.module.ts","src/app/app.component.html","src/app/app.component.ts","src/app/interceptor.ts","src/app/app.module.ts","src/main.ts"],"names":["webpackEmptyAsyncContext","req","Promise","resolve","then","e","Error","code","keys","id","module","exports","config","apiUrl","clientId","PublicRouteGuard","authService","router","next","state","data","isPublicRoute","this","isLoggedIn","isAdmin$","value","navigate","key","orderNumber","RoleGuard","route","expectedRoles","jwtContainer$","subscribe","x","Roles","ClaimRole","expected","actual","find","r","MaterialModule","RoleDefinition","JwtContainer","userId","claimRole","StorageService","localStorage","getItem","removeItem","setItem","httpOptions","headers","AuthService","http","storageService","toastr","dialog","jwtHelper","authData$","BehaviorSubject","storageAuthData","JSON","parse","setAuthorizationData","jwt","loginRequest","post","pipe","tap","authData","authenticateRequest","showMessage","closeAll","success","isGuid","info","of","request","refresh_token","reAuthData","token","decodeToken","accessToken","roles","jwtContainer","UserId","stringify","addItem","test","match","LoginRequest","username","password","userName","SpinnerService","visibility","environment","production","window","_env","title","NotFoundComponent","routes","path","loadChildren","m","AdminModule","canActivate","FormsModule","PublicModule","component","pathMatch","AppRoutingModule","useHash","anchorScrolling","scrollPositionRestoration","AppComponent","spinnerService","showSpinner","val","unsubscribe","Interceptor","tokenSubject","isRefreshingToken","getAuthData","clone","setHeaders","Authorization","setTimeout","url","endsWith","show","body","toString","indexOf","handle","event","hide","addToken","catchError","error","console","log","throwError","status","handle400Error","handle401Error","handle500Error","handleDefaultError","finalize","message","logoutUser","err","E","filter","take","switchMap","currentUser","refreshTokenrequest","refreshToken","authResponse","logout","AppModule","provide","useClass","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KsG,mBAAoB,MAazC,eAAeiB,GAKX,OAJAA,EAAMA,MAAMU,QACVjI,KAAKkC,OAAOqF,MAAMA,EAAMA,MAAMU,SAC1BjI,KAAKkC,OAAOqF,MAAM,wCACxBvH,KAAKgG,eAAeoB,QACb,EAAAM,EAAA,GAAWH,GAGtB,mBAAmBA,GAGf,OAFAvH,KAAKgG,eAAeoB,OACpBpH,KAAKkC,OAAOqF,MAAM,yCACX,EAAAG,EAAA,GAAWH,GAGtB,aACI,OAAOvH,KAAKN,YAAYkJ,QAAO,0CA/I1BxC,GAAW,EAAA,IAAA,EAAA,GAAA,EAAA,IAAA,EAAA,GAAA,EAAA,IAAA,EAAA,gCAAXA,EAAW,QAAXA,EAAW,oCCuBjB,MAAMyC,yCAAAA,4BAAAA,EAAS,UAAA,CAFR9C,kCADD,CAAC,CAAC+C,QAAS,EAAA,GAAmBC,SAAU3C,EAAa4C,OAAO,IAAM,QAAA,CAdlE,CACP,EAAA,GACArD,EACA,EAAA,GACA,EAAA,GACA,EAAA,GAAA,QAAqB,CACnBsD,aAAa,EACbC,QAAS,IACTC,aAAa,EACbC,cAAe,oBAEjB,EAAA,EACA,EAAA,EAAA,sBCvBF,EAAA,aACF,EAAA,EAAA,OAGF,EAAA,KAAyBC,gBAAgBR,GACtCS,MAAMnB,GAAOX,QAAQD,MAAMY","sourceRoot":"webpack:///","sourcesContent":["function webpackEmptyAsyncContext(req) {\n\t// Here Promise.resolve().then() is used instead of new Promise() to prevent\n\t// uncaught exception popping up in devtools\n\treturn Promise.resolve().then(function() {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t});\n}\nwebpackEmptyAsyncContext.keys = function() { return []; };\nwebpackEmptyAsyncContext.resolve = webpackEmptyAsyncContext;\nwebpackEmptyAsyncContext.id = 8255;\nmodule.exports = webpackEmptyAsyncContext;","import {environment} from '../environments/environment';\r\n\r\nexport const config: any = {\r\n apiUrl: environment.apiUrl,\r\n clientId: 'TaxFormDelivery'\r\n};\r\n","import {Injectable} from '@angular/core';\r\nimport {CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, Router} from '@angular/router';\r\nimport {AuthService} from '../services/auth.service';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class PublicRouteGuard implements CanActivate {\r\n constructor(private authService: AuthService, private router: Router) {\r\n }\r\n\r\n canActivate(next: ActivatedRouteSnapshot, state: RouterStateSnapshot) {\r\n const isPublicRoute = next.data.isPublicRoute as boolean;\r\n if (isPublicRoute && this.authService.isLoggedIn()) {\r\n if (this.authService.isAdmin$.value) {\r\n this.router.navigate(['admin/dashboard']).then();\r\n } else {\r\n this.router.navigate([`forms/${this.authService.id.value}/${this.authService.key.value}/${this.authService.orderNumber.value}`]).then(() => {\r\n });\r\n }\r\n\r\n return false;\r\n }\r\n return true;\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { CanActivate, ActivatedRouteSnapshot, Router } from '@angular/router';\r\nimport {AuthService} from '../services/auth.service';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\n\r\nexport class RoleGuard implements CanActivate {\r\n Roles: Array;\r\n constructor(public router: Router, private authService: AuthService) {\r\n }\r\n\r\n canActivate(route: ActivatedRouteSnapshot) {\r\n const expectedRoles = route.data.expectedRoles as Array;\r\n if (!this.authService.isLoggedIn()) {\r\n this.router.navigate(['']).then();\r\n return false;\r\n }\r\n\r\n this.authService.jwtContainer$.subscribe(x => { x ? this.Roles = x.ClaimRole : this.Roles = []; });\r\n for (const expected of expectedRoles) {\r\n for (const actual of this.Roles) {\r\n if (expected === actual) {\r\n return true;\r\n }\r\n }\r\n }\r\n\r\n if (this.Roles.find(r => r === 'Admin')) {\r\n this.router.navigate(['/admin/dashboard']).then(() => false);\r\n } else {\r\n this.router.navigate(['']).then(() => false);\r\n }\r\n }\r\n}\r\n","import {NgModule} from '@angular/core';\r\nimport {MatBadgeModule} from '@angular/material/badge';\r\nimport {MatButtonModule} from '@angular/material/button';\r\nimport {MatCardModule} from '@angular/material/card';\r\nimport {MatCheckboxModule} from '@angular/material/checkbox';\r\nimport {MatDatepickerModule} from '@angular/material/datepicker';\r\nimport {MatFormFieldModule} from '@angular/material/form-field';\r\nimport {MatIconModule} from '@angular/material/icon';\r\nimport {MatInputModule} from '@angular/material/input';\r\nimport {MatListModule} from '@angular/material/list';\r\nimport {MatDialogModule} from '@angular/material/dialog';\r\nimport {MatMenuModule, _MatMenuDirectivesModule} from '@angular/material/menu';\r\nimport {MatProgressSpinnerModule} from '@angular/material/progress-spinner';\r\nimport {MatSidenavModule} from '@angular/material/sidenav';\r\nimport {MatSelectModule} from '@angular/material/select';\r\nimport {MatTableModule} from '@angular/material/table';\r\nimport {MatToolbarModule} from '@angular/material/toolbar';\r\nimport {MatTreeModule} from '@angular/material/tree';\r\nimport {MatSortModule} from '@angular/material/sort';\r\nimport {MatTooltipModule} from '@angular/material/tooltip';\r\n\r\n@NgModule({\r\n imports: [\r\n MatBadgeModule,\r\n MatButtonModule,\r\n MatCardModule,\r\n MatCheckboxModule,\r\n MatDatepickerModule,\r\n MatDialogModule,\r\n MatFormFieldModule,\r\n MatIconModule,\r\n MatInputModule,\r\n MatListModule,\r\n _MatMenuDirectivesModule,\r\n MatProgressSpinnerModule,\r\n MatSelectModule,\r\n MatSidenavModule,\r\n MatSortModule,\r\n MatTableModule,\r\n MatToolbarModule,\r\n MatTooltipModule,\r\n MatTreeModule,\r\n MatMenuModule\r\n ],\r\n exports: [\r\n MatBadgeModule,\r\n MatButtonModule,\r\n MatCardModule,\r\n MatCheckboxModule,\r\n MatDatepickerModule,\r\n MatDialogModule,\r\n MatFormFieldModule,\r\n MatIconModule,\r\n MatInputModule,\r\n MatListModule,\r\n _MatMenuDirectivesModule,\r\n MatProgressSpinnerModule,\r\n MatSelectModule,\r\n MatSidenavModule,\r\n MatSortModule,\r\n MatTableModule,\r\n MatToolbarModule,\r\n MatTreeModule,\r\n MatTooltipModule,\r\n MatMenuModule\r\n ]\r\n})\r\nexport class MaterialModule {\r\n}\r\n","export enum RoleDefinition {\r\n BasicUser = 'BasicUser',\r\n Admin = 'Admin'\r\n}\r\n","export class JwtContainer {\r\n uniqueName: string;\r\n displayName: string;\r\n userId: string;\r\n ClaimRole: string[];\r\n\r\n constructor(userId: string, claimRole: string[]) {\r\n this.ClaimRole = claimRole;\r\n this.userId = userId;\r\n }\r\n}\r\n","import {Injectable} from '@angular/core';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class StorageService {\r\n\r\n constructor() {\r\n }\r\n\r\n getItem(key: string): string {\r\n return localStorage.getItem(key);\r\n }\r\n\r\n removeItem(key: string): void {\r\n localStorage.removeItem(key);\r\n }\r\n\r\n addItem(key: string, data: string): void {\r\n localStorage.setItem(key, data);\r\n }\r\n\r\n}\r\n","import {Injectable} from '@angular/core';\r\nimport {BehaviorSubject, Observable, of} from 'rxjs';\r\nimport {JwtContainer} from '../models/jwt-container.model';\r\nimport {AuthData} from '../models/interfaces/auth-data';\r\nimport {tap} from 'rxjs/operators';\r\nimport {JwtTempContainer} from '../models/jwt-temp-container.model';\r\nimport {HttpClient, HttpHeaders} from '@angular/common/http';\r\nimport {StorageService} from './storage.service';\r\nimport {Router} from '@angular/router';\r\nimport {ToastrService} from 'ngx-toastr';\r\nimport {JwtHelperService} from '@auth0/angular-jwt';\r\nimport {config} from '../app.config';\r\nimport {AuthenticateRequest} from '../models/authenticate.request';\r\nimport {MatDialog} from '@angular/material/dialog';\r\nimport {ExchangeRefreshTokenRequest} from '../models/exchange-refresh-token-request.model';\r\n\r\nconst httpOptions = {\r\n headers: new HttpHeaders({\r\n 'Content-Type': 'application/json;charset=UTF-8'\r\n })\r\n};\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\n\r\nexport class AuthService {\r\n private jwtHelper = new JwtHelperService();\r\n private storageAuthData: AuthData;\r\n authData$ = new BehaviorSubject(null);\r\n jwtContainer$ = new BehaviorSubject(null);\r\n jwt: JwtContainer;\r\n isAdmin$ = new BehaviorSubject(false);\r\n key = new BehaviorSubject(null);\r\n id = new BehaviorSubject(null);\r\n orderNumber = new BehaviorSubject(null);\r\n\r\n constructor(private http: HttpClient, private storageService: StorageService, private router: Router,\r\n private toastr: ToastrService, private dialog: MatDialog) {\r\n this.storageAuthData = this.storageService.getItem('authData$') ?\r\n JSON.parse(this.storageService.getItem('authData$')) as AuthData : null;\r\n\r\n if (this.storageAuthData) {\r\n this.setAuthorizationData(this.storageAuthData);\r\n }\r\n this.jwtContainer$\r\n .subscribe(jwt => {\r\n this.jwt = jwt;\r\n });\r\n }\r\n\r\n login(loginRequest: LoginRequest): Observable {\r\n return this.http.post(config.apiUrl + 'Auth/Login', loginRequest, httpOptions)\r\n .pipe(tap(authData => this.setAuthorizationData(authData)));\r\n }\r\n\r\n authenticate(authenticateRequest: AuthenticateRequest): Observable {\r\n return this.http.post(config.apiUrl + 'Auth/Authenticate', authenticateRequest)\r\n .pipe(tap(authData => this.setAuthorizationData(authData)));\r\n }\r\n\r\n logout(showMessage: boolean = false): Observable {\r\n this.dialog.closeAll();\r\n this.storageAuthData = null;\r\n this.storageService.removeItem('authData$');\r\n this.authData$.next(null);\r\n this.jwtContainer$.next(null);\r\n if (this.isAdmin$.value) {\r\n this.router.navigate(['/login']).then(() => {\r\n if (showMessage) {\r\n this.toastr.success('Please login to continue', 'Your session has expired.');\r\n }\r\n });\r\n } else {\r\n\r\n if (this.key.value !== null && this.isGuid(this.key.value)) {\r\n this.router.navigate([`/${this.key.value}/${this.orderNumber.value}`]).then(() => {\r\n if (showMessage) {\r\n this.toastr.info('', 'Your session has expired.');\r\n }\r\n });\r\n } else {\r\n this.router.navigate(['']).then(() => {\r\n if (showMessage) {\r\n this.toastr.info('', 'Your session has expired.');\r\n }\r\n });\r\n }\r\n }\r\n this.isAdmin$.next(false);\r\n return of(true);\r\n }\r\n\r\n refreshToken(request: ExchangeRefreshTokenRequest): Observable {\r\n if (this.storageAuthData !== null) {\r\n const data = 'grant_type=refresh_token&refresh_token=' +\r\n this.storageAuthData.refresh_token;\r\n return this.http.post(config.apiUrl + 'Auth/refreshtoken', request, httpOptions)\r\n .pipe(\r\n tap(reAuthData => this.setAuthorizationData(reAuthData))\r\n );\r\n }\r\n return of(null as AuthData);\r\n }\r\n\r\n setAuthorizationData(authData: AuthData): void {\r\n this.storageAuthData = authData;\r\n const tokenEnc = this.jwtHelper.decodeToken(authData.accessToken.token);\r\n const token = tokenEnc as JwtTempContainer;\r\n const roles = token.ClaimRole;\r\n const jwtContainer = new JwtContainer(token.UserId, [roles]);\r\n\r\n this.authData$.next(authData);\r\n this.jwtContainer$.next(jwtContainer);\r\n\r\n const authorizationDataStorage = JSON.stringify(this.storageService.getItem('authData$'));\r\n if (authorizationDataStorage !== null) {\r\n this.storageService.removeItem('authData$');\r\n }\r\n this.storageService.addItem('authData$', JSON.stringify(authData));\r\n\r\n if (roles === 'Admin') {\r\n this.isAdmin$.next(true);\r\n }\r\n }\r\n\r\n isLoggedIn() {\r\n return !!this.jwt;\r\n }\r\n\r\n getAuthData(): AuthData {\r\n return this.storageAuthData;\r\n }\r\n\r\n isGuid(value: string): boolean {\r\n let test: RegExpMatchArray;\r\n // Regex successfully tested against 966 guids from database...\r\n test = value.match('^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$');\r\n if (test !== null) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }\r\n}\r\n\r\nexport class LoginRequest {\r\n userName: string;\r\n password: string;\r\n\r\n public constructor(username: string, password: string) {\r\n this.userName = username;\r\n this.password = password;\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport {BehaviorSubject} from 'rxjs';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class SpinnerService {\r\n visibility: BehaviorSubject;\r\n\r\n constructor() {\r\n this.visibility = new BehaviorSubject(false);\r\n }\r\n\r\n show() {\r\n this.visibility.next(true);\r\n }\r\n\r\n hide() {\r\n this.visibility.next(false);\r\n }\r\n}\r\n","// This file can be replaced during build by using the `fileReplacements` array.\r\n// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.\r\n// The list of file replacements can be found in `angular.json`.\r\n\r\nexport const environment = {\r\n production: false,\r\n apiUrl: (window as any)._env.apiUrl,\r\n title: (window as any)._env.title\r\n};\r\n\r\n/*\r\n * For easier debugging in development mode, you can import the following file\r\n * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.\r\n *\r\n * This import should be commented out in production mode because it will have a negative impact\r\n * on performance if an error is thrown.\r\n */\r\n// import 'zone.js/dist/zone-error'; // Included with Angular CLI.\r\n","import { Component, OnInit } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'app-not-found',\r\n templateUrl: './not-found.component.html',\r\n styleUrls: ['./not-found.component.scss']\r\n})\r\nexport class NotFoundComponent implements OnInit {\r\n\r\n constructor() { }\r\n\r\n ngOnInit(): void {\r\n }\r\n\r\n}\r\n","

\r\n \r\n \r\n \r\n article\r\n Tax Form Delivery\r\n \r\n

\r\n\r\n \r\n \r\n \r\n Page Not Found!\r\n The page you requested could not be found.\r\n \r\n \r\n \r\n\r\n","import {NgModule} from '@angular/core';\r\nimport {RouterModule, Routes} from '@angular/router';\r\nimport {RoleDefinition} from './models/enums/role-definition.enum';\r\nimport {PublicRouteGuard} from './guards/public-route.guard';\r\nimport {RoleGuard} from './guards/role.guard';\r\nimport {NotFoundComponent} from './components/not-found/not-found.component';\r\n\r\n\r\nconst routes: Routes = [\r\n {\r\n path: 'admin',\r\n loadChildren: () => import('./features/admin/admin.module').then(m => m.AdminModule),\r\n data: {isPublicRoute: false, expectedRoles: [RoleDefinition.Admin]},\r\n canActivate: [RoleGuard]\r\n },\r\n {\r\n path: 'forms',\r\n loadChildren: () => import('./features/forms/forms.module').then(m => m.FormsModule),\r\n data: {isPublicRoute: false, expectedRoles: [RoleDefinition.BasicUser]},\r\n canActivate: [RoleGuard]\r\n },\r\n {\r\n path: '',\r\n loadChildren: () => import('./features/public/public.module').then(m => m.PublicModule),\r\n data: {isPublicRoute: true},\r\n canActivate: [PublicRouteGuard]\r\n },\r\n {\r\n path: '**',\r\n component: NotFoundComponent,\r\n pathMatch: 'full'\r\n }\r\n];\r\n\r\n@NgModule({\r\n imports: [RouterModule.forRoot(routes, {\r\n useHash: false,\r\n anchorScrolling: 'enabled',\r\n scrollPositionRestoration: 'enabled'\r\n })],\r\n exports: [RouterModule]\r\n})\r\nexport class AppRoutingModule {\r\n}\r\n","
\r\n
\r\n \r\n
\r\n
\r\n\r\n\r\n","import {Component, OnDestroy} from '@angular/core';\r\nimport {SpinnerService} from './services/spinner.service';\r\n\r\n@Component({\r\n selector: 'app-root',\r\n templateUrl: './app.component.html',\r\n styleUrls: ['./app.component.scss']\r\n})\r\nexport class AppComponent implements OnDestroy {\r\n title = 'EtInvest-TaxFormDelivery-Ui';\r\n showSpinner = false;\r\n\r\n constructor(public spinnerService: SpinnerService) {\r\n this.spinnerService.visibility.subscribe(val => {\r\n this.showSpinner = val;\r\n });\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this.spinnerService.visibility.unsubscribe();\r\n }\r\n}\r\n","import {Injectable} from '@angular/core';\r\nimport {HttpErrorResponse, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest, HttpResponse} from '@angular/common/http';\r\nimport {BehaviorSubject, EMPTY, Observable, of, throwError} from 'rxjs';\r\nimport {catchError, debounce, debounceTime, filter, finalize, switchMap, take, tap} from 'rxjs/operators';\r\nimport {AuthService} from './services/auth.service';\r\nimport {SpinnerService} from './services/spinner.service';\r\nimport {ToastrService} from 'ngx-toastr';\r\nimport {config} from './app.config';\r\nimport {ExchangeRefreshTokenRequest} from './models/exchange-refresh-token-request.model';\r\n\r\n@Injectable()\r\nexport class Interceptor implements HttpInterceptor {\r\n private tokenSubject: BehaviorSubject = new BehaviorSubject(null);\r\n private isRefreshingToken = false;\r\n\r\n constructor(private authService: AuthService,\r\n public spinnerService: SpinnerService,\r\n public toastr: ToastrService) {\r\n }\r\n\r\n private addToken(req: HttpRequest) {\r\n const authData = this.authService.getAuthData();\r\n if (authData) {\r\n return req.clone({setHeaders: {Authorization: 'Bearer ' + authData.accessToken.token}});\r\n } else {\r\n return req;\r\n }\r\n }\r\n\r\n intercept(req: HttpRequest, next: HttpHandler): Observable> {\r\n setTimeout(() => {\r\n if (!req.url.endsWith('svg') && !req.url.endsWith('/GetCommunicationsProgress')) {\r\n this.spinnerService.show();\r\n }\r\n });\r\n // un-authorized request\r\n if (req.url.endsWith('/logout') || (req.url.endsWith('/Login') && req.body.toString().indexOf('grant_type=refresh_token') > -1)) {\r\n return next.handle(req).pipe(\r\n tap((event: HttpEvent) => {\r\n setTimeout(() => {\r\n this.spinnerService.hide();\r\n }, 500);\r\n })\r\n );\r\n } else {\r\n // authorized request\r\n req = this.addToken(req);\r\n return next.handle(req)\r\n .pipe(\r\n catchError(error => {\r\n if (error instanceof HttpErrorResponse) {\r\n switch ((error as HttpErrorResponse).status) {\r\n case 400:\r\n return this.handle400Error(error);\r\n case 401:\r\n return this.handle401Error(error, req, next);\r\n case 500:\r\n return this.handle500Error(error);\r\n default:\r\n return this.handleDefaultError(error);\r\n }\r\n } else {\r\n console.log('intercept, other error occurred');\r\n setTimeout(() => {\r\n this.spinnerService.hide();\r\n }, 500);\r\n\r\n return throwError(error);\r\n }\r\n }),\r\n finalize(() => {\r\n setTimeout(() => {\r\n this.spinnerService.hide();\r\n }, 500);\r\n })\r\n );\r\n }\r\n }\r\n\r\n handle400Error(error: HttpErrorResponse): Observable> {\r\n this.toastr.error(error.error.message);\r\n this.spinnerService.hide();\r\n if (this.authService.isLoggedIn && error && error.status === 400 && !error.error) {\r\n return this.logoutUser();\r\n }\r\n return throwError(error);\r\n }\r\n\r\n handle401Error(err: HttpErrorResponse, req: HttpRequest, next: HttpHandler): Observable> {\r\n if (req.url.endsWith('/Login')) {\r\n this.toastr.error('Username or Password are Incorrect.');\r\n return EMPTY;\r\n } else if (req.url.endsWith('/Authenticate')) {\r\n this.toastr.error(err.error.message);\r\n return EMPTY;\r\n }\r\n this.spinnerService.hide();\r\n if (!this.isRefreshingToken) {\r\n this.isRefreshingToken = true;\r\n this.tokenSubject.next(null);\r\n\r\n const currentUser = JSON.parse(localStorage.getItem('authData$'));\r\n\r\n const refreshTokenrequest = {\r\n accessToken: currentUser.accessToken.token,\r\n refreshToken: currentUser.refreshToken,\r\n clientId: config.clientId\r\n } as ExchangeRefreshTokenRequest;\r\n\r\n return this.authService.refreshToken(refreshTokenrequest).pipe(\r\n switchMap((authResponse) => {\r\n if (authResponse.accessToken !== null) {\r\n this.tokenSubject.next(authResponse.accessToken);\r\n return next.handle(this.addToken(req));\r\n }\r\n // If we don't get a new token, we are in trouble so logout.\r\n return this.logoutUser();\r\n }),\r\n catchError(error => {\r\n // logout if second 401 is thrown, user is unauthorized with new token.\r\n if (error instanceof HttpErrorResponse && (error as HttpErrorResponse).status === 401) {\r\n return this.logoutUser();\r\n }\r\n return throwError(error);\r\n }),\r\n finalize(() => {\r\n this.isRefreshingToken = false;\r\n })\r\n );\r\n } else {\r\n return this.tokenSubject.pipe(\r\n filter(token => token !== null),\r\n take(1),\r\n switchMap(() => {\r\n return next.handle(this.addToken(req));\r\n }));\r\n }\r\n }\r\n\r\n handle500Error(error: HttpErrorResponse): Observable> {\r\n error.error.message\r\n ? this.toastr.error(error.error.message)\r\n : this.toastr.error('An error occurred, please try again.');\r\n this.spinnerService.hide();\r\n return throwError(error);\r\n }\r\n\r\n handleDefaultError(error: HttpErrorResponse): Observable> {\r\n this.spinnerService.hide();\r\n this.toastr.error('An error occurred, please try again.');\r\n return throwError(error);\r\n }\r\n\r\n logoutUser(): Observable {\r\n return this.authService.logout(true);\r\n }\r\n}\r\n","import { BrowserModule } from '@angular/platform-browser';\r\nimport { NgModule } from '@angular/core';\r\nimport { AppRoutingModule } from './app-routing.module';\r\nimport { AppComponent } from './app.component';\r\nimport { BrowserAnimationsModule } from '@angular/platform-browser/animations';\r\nimport {HTTP_INTERCEPTORS, HttpClientModule} from '@angular/common/http';\r\nimport {ToastrModule} from 'ngx-toastr';\r\nimport { Interceptor } from './interceptor';\r\nimport { NotFoundComponent } from './components/not-found/not-found.component';\r\nimport { MaterialModule } from './material.module';\r\nimport {NgIdleKeepaliveModule} from '@ng-idle/keepalive';\r\n\r\n@NgModule({\r\n declarations: [\r\n AppComponent,\r\n NotFoundComponent\r\n ],\r\n imports: [\r\n BrowserModule,\r\n AppRoutingModule,\r\n BrowserAnimationsModule,\r\n HttpClientModule,\r\n ToastrModule.forRoot({\r\n closeButton: true,\r\n timeOut: 6000,\r\n progressBar: true,\r\n positionClass: 'toast-top-right'\r\n }),\r\n MaterialModule,\r\n NgIdleKeepaliveModule.forRoot()\r\n ],\r\n providers: [{provide: HTTP_INTERCEPTORS, useClass: Interceptor, multi: true}],\r\n bootstrap: [AppComponent]\r\n})\r\nexport class AppModule { }","import { enableProdMode } from '@angular/core';\r\nimport { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\r\n\r\nimport { AppModule } from './app/app.module';\r\nimport { environment } from './environments/environment';\r\n\r\nif (environment.production) {\r\n enableProdMode();\r\n}\r\n\r\nplatformBrowserDynamic().bootstrapModule(AppModule)\r\n .catch(err => console.error(err));\r\n"]}