Socket
Socket
Sign inDemoInstall

@http-ext/plugin-auth

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@http-ext/plugin-auth - npm Package Compare versions

Comparing version 2.1.0 to 2.1.1

jest.config.js

8

CHANGELOG.md

@@ -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 @@

23

package.json
{
"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).
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc