nz-ng2-interceptors
Version:
Angular Cache interceptor, Token authentication interceptor, CSRF XSRF interceptor
39 lines (30 loc) • 925 B
Markdown
# nz-ng2-interceptors

[](https://codecov.io/gh/ywarezk/ng2-interceptors)
## About
This package contains recommended interceptors to use in your app.
## Installation
```bash
npm install nz-ng2-interceptors --save
```
in your module add the interceptors you need
```typescript
@NgModule({
imports: [
CsrfModule.withOptions(),
TokenAuthenticationModule.withOptions({
tokenStoredIn: TokenStorages.cookies,
tokenKeyName: environment.tokenCookieName
}),
DecorateRequestModule.withOptions({
params: {format: 'json'},
headers: {
'Content-Type': 'application/json'
},
url: environment.serverUrl
}),
]
})
```
## License
MIT