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
-[Auth0 blog - Refresh Tokens: When to Use Them and How They Interact with JWTs](https://auth0.com/blog/refresh-tokens-what-are-they-and-when-to-use-them/)
9
+
-[Shoutem blog - Keeping your tokens fresh](https://medium.com/shoutem/keeping-your-api-tokens-fresh-72059a7b0586)
9
10
10
11
>Note:
11
12
This library expects that fetch and promise api's are available at target environment. You should
@@ -46,7 +47,7 @@ config: {
46
47
47
48
// Checks if response should be considered unauthorized (by default only 401 responses are
48
49
// considered unauthorized). Override this method if you need to trigger token renewal for
49
-
// other response statuses.
50
+
// other response statuses. Check API reference for helper method which defines default behaviour
50
51
isResponseUnauthorized: (response) => boolean,
51
52
52
53
// (Required) Adds authorization for intercepted requests
@@ -97,7 +98,7 @@ to stop fetch interception.
97
98
...
98
99
```
99
100
100
-
## API reference
101
+
## API reference <aname="api-reference"></a>
101
102
102
103
### Exports
103
104
`configure(configuration)`
@@ -112,6 +113,14 @@ to stop fetch interception.
112
113
113
114
Clears all tokens from interceptor.
114
115
116
+
`isResponseUnauthorized(response)`
117
+
118
+
Utility method which determines if given response should be considered unauthorized.
119
+
By default, responses with status code `401` are considered unauthorized.
120
+
You can use this method in `isResponseUnauthorized` of `config` object
0 commit comments