Skip to content

Commit e815752

Browse files
docs: add docs for token.global option (#1198)
* Add docs on token.global option * Fix issues
1 parent cc99959 commit e815752

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

docs/content/en/api/options.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,14 @@ Default:
4545
```js
4646
auth: {
4747
token: {
48-
prefix: '_token.'
48+
prefix: '_token.',
49+
global: true,
4950
}
5051
}
5152
```
5253

5354
* **prefix** - Default prefix used in building a key for token storage across all storage providers.
55+
* **global** - Whether to automatically include the authentication token in all axios requests.
5456

5557
## `localStorage`
5658

@@ -69,7 +71,7 @@ auth: {
6971
You can disable use of localStorage by setting `localStorage` to `false`, like so:
7072

7173
```js
72-
auth {
74+
auth: {
7375
localStorage: false
7476
}
7577
```
@@ -104,7 +106,7 @@ Note: Using cookies is effectively **required** for univeral mode (SSR) apps bec
104106
You can disable use of cookie storage by setting `cookie` to `false`, like so:
105107

106108
```js
107-
auth: {
109+
auth: {
108110
cookie: false
109111
}
110112
```

docs/content/en/schemes/local.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ auth: {
114114
local: {
115115
token: {
116116
property: 'token',
117+
global: true,
117118
// required: true,
118119
// type: 'Bearer'
119120
},
@@ -175,6 +176,13 @@ This option can be used to disable all token handling.
175176
Useful for Cookie only flows.
176177
:::
177178

179+
#### `global`
180+
181+
- Default: `true`
182+
183+
This determines if the authentication token is automatically included in all custom axios requests.
184+
185+
178186
#### `name`
179187

180188
- Default: `Authorization`

docs/content/en/schemes/refresh.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ auth: {
7474
token: {
7575
property: 'access_token',
7676
maxAge: 1800,
77+
global: true,
7778
// type: 'Bearer'
7879
},
7980
refreshToken: {
@@ -113,6 +114,12 @@ Here you configure the token options.
113114

114115
`property` can be used to specify which field of the response JSON to be used for value. It can be `false` to directly use API response or being more complicated like `auth.token`.
115116

117+
#### `global`
118+
119+
- Default: `true`
120+
121+
This determines if the authentication token is automatically included in all custom axios requests.
122+
116123
#### `name`
117124

118125
- Default: `Authorization`

0 commit comments

Comments
 (0)