@squiz/resource-browser 3.3.4 → 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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # Change Log
2
2
 
3
+ ## 3.3.5
4
+
5
+ ### Patch Changes
6
+
7
+ - 856a08e: Support AssetBank resources
8
+
3
9
  ## 3.3.4
4
10
 
5
11
  ### Patch Changes
@@ -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.4",
3
+ "version": "3.3.5",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "private": false,
@@ -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]);