You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11-21
Original file line number
Diff line number
Diff line change
@@ -6,8 +6,7 @@
6
6
7
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].
8
8
9
-
**Because user's credentials and tokens are exchanged between the
10
-
Ember.js app and the server, you must use HTTPS for this connection!**
9
+
**Because user's credentials and tokens are exchanged between the Ember.js app and the server, you must use HTTPS for this connection!**
The JSON Web Token authenticator will decode the token and look for the
72
-
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.
70
+
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.
73
71
74
72
```js
75
73
// config/environment.js
@@ -99,9 +97,15 @@ To debug JSON Web Token issues, see [jwt][jwt].
99
97
100
98
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].
101
99
102
-
### Adapter Mixin
100
+
### Mixins
103
101
104
-
In order to send the token with all API requests made to the server, the token adapter mixin should be used:
102
+
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:
103
+
104
+
```
105
+
Authorization: Bearer <token>
106
+
```
107
+
108
+
#### Adapter Mixin
105
109
106
110
```js
107
111
// app/adapters/application.js
@@ -111,15 +115,7 @@ import TokenAdapterMixin from 'ember-simple-auth-token/mixins/token-adapter';
Copy file name to clipboardExpand all lines: package.json
+1-1
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
{
2
2
"name": "ember-simple-auth-token",
3
-
"version": "5.1.0",
3
+
"version": "5.1.1",
4
4
"description": "An authenticator and authorizer for Ember Simple Auth that is compatible with token-based authentication like JWT in Ember CLI applications.",
0 commit comments