@squiz/resource-browser 3.3.3 → 3.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -2
- package/lib/Hooks/useAuth.js +2 -0
- package/package.json +2 -2
- package/src/Hooks/useAuth.ts +3 -1
package/CHANGELOG.md
CHANGED
@@ -1,12 +1,20 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
-
## 3.3.
|
3
|
+
## 3.3.5
|
4
4
|
|
5
5
|
### Patch Changes
|
6
6
|
|
7
|
+
- 856a08e: Support AssetBank resources
|
8
|
+
|
9
|
+
## 3.3.4
|
10
|
+
|
11
|
+
### Patch Changes
|
12
|
+
|
13
|
+
- f115dfb: Version fix. Asset bank 401 fix for xml response
|
7
14
|
- 4bdb412: Add classes to resource picker elements
|
15
|
+
- Updated dependencies [f115dfb]
|
8
16
|
- Updated dependencies [4bdb412]
|
9
|
-
- @squiz/resource-browser-ui-lib@1.2.
|
17
|
+
- @squiz/resource-browser-ui-lib@1.2.4
|
10
18
|
|
11
19
|
## 3.3.1
|
12
20
|
|
package/lib/Hooks/useAuth.js
CHANGED
@@ -17,6 +17,8 @@ const useAuth = (authConfig) => {
|
|
17
17
|
catch {
|
18
18
|
setAuthToken(null);
|
19
19
|
setIsAuthenticated(false);
|
20
|
+
// Clear cookies associated with invalidated tokens
|
21
|
+
(0, authUtils_1.logout)();
|
20
22
|
throw new Error('Session expired. Please log in again.');
|
21
23
|
}
|
22
24
|
}, [authConfig]);
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@squiz/resource-browser",
|
3
|
-
"version": "3.3.
|
3
|
+
"version": "3.3.5",
|
4
4
|
"main": "lib/index.js",
|
5
5
|
"types": "lib/index.d.ts",
|
6
6
|
"private": false,
|
@@ -28,7 +28,7 @@
|
|
28
28
|
"@react-types/shared": "^3.23.1",
|
29
29
|
"@squiz/dx-json-schema-lib": "^1.67.0",
|
30
30
|
"@squiz/generic-browser-lib": "1.67.2",
|
31
|
-
"@squiz/resource-browser-ui-lib": "^1.2.
|
31
|
+
"@squiz/resource-browser-ui-lib": "^1.2.4",
|
32
32
|
"clsx": "^2.1.0",
|
33
33
|
"expiry-map": "^2.0.0",
|
34
34
|
"p-memoize": "^4.0.4",
|
package/src/Hooks/useAuth.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
/* eslint-disable no-console */
|
2
2
|
import { useState, useCallback, useEffect } from 'react';
|
3
3
|
import { AuthenticationConfiguration } from '../types';
|
4
|
-
import { getCookieValue, refreshAccessToken as refreshTokenUtil } from '../utils/authUtils';
|
4
|
+
import { getCookieValue, refreshAccessToken as refreshTokenUtil, logout } from '../utils/authUtils';
|
5
5
|
|
6
6
|
export const useAuth = (authConfig: AuthenticationConfiguration | undefined) => {
|
7
7
|
const [authToken, setAuthToken] = useState<string | null>(getCookieValue('authToken'));
|
@@ -16,6 +16,8 @@ export const useAuth = (authConfig: AuthenticationConfiguration | undefined) =>
|
|
16
16
|
} catch {
|
17
17
|
setAuthToken(null);
|
18
18
|
setIsAuthenticated(false);
|
19
|
+
// Clear cookies associated with invalidated tokens
|
20
|
+
logout();
|
19
21
|
throw new Error('Session expired. Please log in again.');
|
20
22
|
}
|
21
23
|
}, [authConfig]);
|