src/app/_interceptors/http-config.interceptor.ts
Methods |
constructor()
|
intercept | |||||||||
intercept(request: HttpRequest
|
|||||||||
Parameters :
Returns :
Observable<HttpEvent<unknown>>
|
import { Injectable } from '@angular/core';
import { HttpRequest, HttpHandler, HttpEvent, HttpInterceptor } from '@angular/common/http';
import { Observable } from 'rxjs';
@Injectable()
export class HttpConfigInterceptor implements HttpInterceptor {
constructor() {}
intercept(request: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>> {
// const token: string = sessionStorage.getItem(btoa('CICADA_SESSION_TOKEN'));
// if (token) {
// request = request.clone({headers: request.headers.set('Authorization', 'Bearer ' + token)});
// }
return next.handle(request);
}
}