@http-ext/plugin-auth
Advanced tools
Comparing version 2.1.0 to 2.1.1
@@ -6,2 +6,10 @@ # Change Log | ||
## [2.1.1](https://github.com/jscutlery/http-ext/compare/v2.1.0...v2.1.1) (2020-04-16) | ||
**Note:** Version bump only for package @http-ext/plugin-auth | ||
# [2.1.0](https://github.com/jscutlery/http-ext/compare/v2.0.1...v2.1.0) (2020-04-11) | ||
@@ -8,0 +16,0 @@ |
{ | ||
"name": "@http-ext/plugin-auth", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"license": "MIT", | ||
"private": false, | ||
"repository": "git@github.com:jscutlery/http-ext.git", | ||
"scripts": { | ||
"publish": "yarn publish ../../dist/libs/plugin-auth" | ||
}, | ||
"peerDependencies": { | ||
"@http-ext/core": "^2.0.0", | ||
"rxjs": "^6.5.4", | ||
"tslib": "^1.10.0" | ||
}, | ||
"main": "bundles/http-ext-plugin-auth.umd.js", | ||
"module": "fesm5/http-ext-plugin-auth.js", | ||
"es2015": "fesm2015/http-ext-plugin-auth.js", | ||
"esm5": "esm5/http-ext-plugin-auth.js", | ||
"esm2015": "esm2015/http-ext-plugin-auth.js", | ||
"fesm5": "fesm5/http-ext-plugin-auth.js", | ||
"fesm2015": "fesm2015/http-ext-plugin-auth.js", | ||
"typings": "http-ext-plugin-auth.d.ts", | ||
"metadata": "http-ext-plugin-auth.metadata.json", | ||
"sideEffects": false | ||
"rxjs": "^6.5.4" | ||
} | ||
} |
@@ -6,2 +6,3 @@ # @http-ext/plugin-auth | ||
This plugin takes care of handling authorization by: | ||
- adding the `Authorization` header with the given token automatically for each request matching a custom condition, | ||
@@ -48,7 +49,7 @@ - triggering a custom token expiration logic on `401 Unauthorized` http responses. | ||
token: authService.getToken(), // Returns an Observable<string>. | ||
onUnauthorized: () => authService.markTokenExpired() | ||
}) | ||
}) | ||
onUnauthorized: () => authService.markTokenExpired(), | ||
}), | ||
}), | ||
], | ||
bootstrap: [AppComponent] | ||
bootstrap: [AppComponent], | ||
}) | ||
@@ -62,8 +63,8 @@ export class AppModule {} | ||
| Property | Type | Required | Default value | Description | | ||
| -------------------- | -------------------- | ---------| ---------------------------------------| -------------------------------------------------------------------------------------------- | | ||
| `token` | `Observable<string>` | Yes | `undefined` | The bearer token that will be added to every matching request in the `Authorization` header. | | ||
| `onUnauthorized` | `OnUnauthorized` | No | `undefined` | A function executed when an unauthorized response is thrown. | | ||
| `shouldHandleRequest`| `RequestCondition` | No | `matchOrigin('https://my-origin.com')` | Predicate function to know which request the plugin should handle. | | ||
| Property | Type | Required | Default value | Description | | ||
| --------------------- | -------------------- | -------- | ------------- | -------------------------------------------------------------------------------------------- | | ||
| `token` | `Observable<string>` | Yes | `undefined` | The bearer token that will be added to every matching request in the `Authorization` header. | | ||
| `onUnauthorized` | `OnUnauthorized` | No | `undefined` | A function executed when an unauthorized response is thrown. | | ||
| `shouldHandleRequest` | `RequestCondition` | No | `undefined` | Predicate function to know which request the plugin should handle. | | ||
To know more about the `shouldHandleRequest` property check-out the [conditional handling section](https://github.com/jscutlery/http-ext#conditional-handling). |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
2
1
68
14538
19
279
1