anti-tamper
v1.5.0
Published
``` bash angular 17+ npm i anti-tamper
Downloads
52
Readme
Getting started
Installation
angular 17+
npm i anti-tamper
angular <= 16
npm i [email protected]
Import
No import required in app.module.ts
Usage Typescript
In your interceptor:
import { DigestHeaderService } from 'anti-tamper';
import { from, Observable } from 'rxjs';
.
.
.
export class HeaderInterceptor implements HttpInterceptor {
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
.
.
.
const headers : HttpRequest<any> = req.clone({
headers: req.headers.set('Authorization', `Bearer ${token}`)
});
return from (DigestHeaderService.add(headers, key, iv))
.pipe(
switchMap(headers_digest => {
return next.handle(headers_digest);
})
);
}
}