From 06b6bb4e33e333fedc4a318f29369f9f8f208e56 Mon Sep 17 00:00:00 2001 From: Alec Fenichel Date: Wed, 29 Jul 2020 10:48:11 -0400 Subject: [PATCH 1/3] Update readme --- README.md | 32 +++++++++++--------------------- 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 5d0ad3d..af18d2f 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,7 @@ This is Ember addon is an extension to the Ember Simple Auth library that provides a basic token authenticator, a JSON Web Tokens token authenticator with automatic refresh capability, and an authorizer mixin. You can find more about why JSON Web Tokens are so awesome in [this article][medium-jwt]. -**Because user's credentials and tokens are exchanged between the -Ember.js app and the server, you must use HTTPS for this connection!** +**Because user's credentials and tokens are exchanged between the Ember.js app and the server, you must use HTTPS for this connection!** ## Demo @@ -68,8 +67,7 @@ export default Controller.extend({ #### JSON Web Token Authenticator -The JSON Web Token authenticator will decode the token and look for the -expiration time found. The difference in the current time and the token expiration time is calculated. The `refreshLeeway` is subtracted from this value to determine when the automatic token refresh request should be made. +The JSON Web Token authenticator will decode the token and look for the expiration time found. The difference in the current time and the token expiration time is calculated. The `refreshLeeway` is subtracted from this value to determine when the automatic token refresh request should be made. ```js // config/environment.js @@ -99,9 +97,15 @@ To debug JSON Web Token issues, see [jwt][jwt]. The JSON Web Token authenticator supports both separate access tokens and refresh tokens. By specifying the `tokenPropertyName` and the `refreshTokenPropertyName` to the same value, the same token will be used for both access and refresh requests. For more information about refresh tokens, see [this blog][blog-refresh-token]. -### Adapter Mixin +### Mixins -In order to send the token with all API requests made to the server, the token adapter mixin should be used: +In order to send the token with all API requests made to the server, the `token-adapter` mixin or `token-authorizer` mixin should be used. When using `ember-simple-auth` >= 3.0.0, use the `token-adapter` mixin. When using `ember-simple-auth` < 3.0.0, use the `token-authorizer` mixin. The mixin will add the header to each API request: + +``` +Authorization: Bearer +``` + +#### Adapter Mixin ```js // app/adapters/application.js @@ -111,15 +115,7 @@ import TokenAdapterMixin from 'ember-simple-auth-token/mixins/token-adapter'; export default DS.JSONAPIAdapter.extend(TokenAdapterMixin); ``` -The mixin will add the header to each API request: - -``` -Authorization: Bearer -``` - -### Authorizer Mixin - -In order to send the token with all API requests made to the server, the token authorizer mixin should be used: +#### Authorizer Mixin ```js // app/adapters/application.js @@ -129,12 +125,6 @@ import TokenAuthorizerMixin from 'ember-simple-auth-token/mixins/token-authorize export default DS.JSONAPIAdapter.extend(TokenAuthorizerMixin); ``` -The mixin will add the header to each API request: - -``` -Authorization: Bearer -``` - ### Customization Options #### Token Authenticator From d114259758b95b3a8243f02d9e6f3158586eae78 Mon Sep 17 00:00:00 2001 From: Alec Fenichel Date: Wed, 29 Jul 2020 10:48:21 -0400 Subject: [PATCH 2/3] Update packages --- package-lock.json | 49 ++++++++++++++++------------------------------- 1 file changed, 17 insertions(+), 32 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9b7078a..51dbdb8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5688,9 +5688,9 @@ } }, "eventemitter3": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.0.tgz", - "integrity": "sha512-ivIvhpq/Y0uSjcHDcOIccjmYjGLcP09MFGE7ysAwkAvkXfpZlC985pH2/ui64DKazbTW/4kN3yqozUxlXzI6cA==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.4.tgz", + "integrity": "sha512-rlaVLnVxtxvoyLsQQFBx53YmXHDxRIzzTLbdfxqi4yocpSjAxXwkU0cScM5JgSKMqEhrZpnvQ2D9gjylR0AimQ==", "dev": true }, "events-to-array": { @@ -8218,24 +8218,10 @@ } }, "follow-redirects": { - "version": "1.5.10", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz", - "integrity": "sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==", - "dev": true, - "requires": { - "debug": "=3.1.0" - }, - "dependencies": { - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - } - } + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.12.1.tgz", + "integrity": "sha512-tmRv0AVuR7ZyouUHLeNSiO6pqulF7dYa3s19c6t+wz9LD69/uSzdMxJ2S91nTI9U3rt/IldxpzMOFejp6f0hjg==", + "dev": true }, "forwarded": { "version": "0.1.2", @@ -9387,12 +9373,12 @@ "dev": true }, "http-proxy": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.17.0.tgz", - "integrity": "sha512-Taqn+3nNvYRfJ3bGvKfBSRwy1v6eePlm3oc/aWVxZp57DQr5Eq3xhKJi7Z4hZpS8PC3H4qI+Yly5EmFacGuA/g==", + "version": "1.18.1", + "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", + "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==", "dev": true, "requires": { - "eventemitter3": "^3.0.0", + "eventemitter3": "^4.0.0", "follow-redirects": "^1.0.0", "requires-port": "^1.0.0" } @@ -9686,10 +9672,9 @@ } }, "jquery": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.4.1.tgz", - "integrity": "sha512-36+AdBzCL+y6qjw5Tx7HgzeGCzC81MDDgaUP8ld2zhx58HdqXGoBd+tHdrBMiyjGQs0Hxs/MLZTu/eHNJJuWPw==", - "dev": true + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.5.1.tgz", + "integrity": "sha512-XwIBPqcMn57FxfT+Go5pzySnm4KWkT1Tv7gjrpT1srtf8Weynl6R273VJ5GjkRb51IzMp5nbaPjJXMWeju2MKg==" }, "js-reporters": { "version": "1.2.1", @@ -9943,9 +9928,9 @@ } }, "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" + "version": "4.17.19", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", + "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==" }, "lodash._baseassign": { "version": "3.2.0", From 6bc0db50ad3d158c8d11360563216e65ea48e5d7 Mon Sep 17 00:00:00 2001 From: Alec Fenichel Date: Wed, 29 Jul 2020 10:50:18 -0400 Subject: [PATCH 3/3] v5.1.1 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 51dbdb8..16a146c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "ember-simple-auth-token", - "version": "5.1.0", + "version": "5.1.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index b678eaf..39b20f4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ember-simple-auth-token", - "version": "5.1.0", + "version": "5.1.1", "description": "An authenticator and authorizer for Ember Simple Auth that is compatible with token-based authentication like JWT in Ember CLI applications.", "directories": { "doc": "doc",