Skip to content

Instantly share code, notes, and snippets.

@Devstackr8
Devstackr8 / web-req.interceptor.ts
Created August 24, 2019 08:57
Web Request Interceptor (Auth tokens)
import { Injectable } from "@angular/core";
import { HttpInterceptor, HttpRequest, HttpHandler, HttpErrorResponse } from '@angular/common/http';
import { Observable, throwError } from 'rxjs';
import { AuthService } from './services/auth.service';
import { catchError, switchMap } from 'rxjs/operators';
@Injectable({
providedIn: 'root'
})