File tree 1 file changed +20
-3
lines changed
1 file changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ Promise based example:
32
32
const auth = require (' @adobe/jwt-auth' );
33
33
34
34
auth (config)
35
- .then (token => console .log (token ))
35
+ .then (tokenResponse => console .log (tokenResponse ))
36
36
.catch (error => console .log (error));
37
37
```
38
38
@@ -41,8 +41,17 @@ Async/Await based example:
41
41
``` javascript
42
42
const auth = require (' @adobe/jwt-auth' );
43
43
44
- let token = await auth (config);
45
- console .log (token);
44
+ let tokenResponse = await auth (config);
45
+ console .log (tokenResponse);
46
+ ```
47
+
48
+ or (if you don't care about the other properties in the token response)
49
+
50
+ ``` javascript
51
+ const auth = require (' @adobe/jwt-auth' );
52
+
53
+ let { access_token } = await auth (config);
54
+ console .log (access_token);
46
55
```
47
56
48
57
#### Config object
@@ -96,6 +105,14 @@ const config = {
96
105
97
106
This is the recommended approach.
98
107
108
+ #### Response Object
109
+
110
+ The response object contains three keys:
111
+
112
+ * ` token_type `
113
+ * ` access_token `
114
+ * ` expires_in `
115
+
99
116
#### Example
100
117
101
118
``` javascript
You can’t perform that action at this time.
0 commit comments