payload 0.18.2 → 0.18.3

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,3 +1,10 @@
1
+ ## [0.18.3](https://github.com/payloadcms/payload/compare/v0.18.2...v0.18.3) (2022-06-24)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * [#670](https://github.com/payloadcms/payload/issues/670), max tokenExpiration ([918062d](https://github.com/payloadcms/payload/commit/918062de2fba371068efc62a989a93ee07fd4c17))
7
+
1
8
  ## [0.18.2](https://github.com/payloadcms/payload/compare/v0.18.1...v0.18.2) (2022-06-24)
2
9
 
3
10
 
@@ -6,6 +6,7 @@ import { useConfig } from '../Config';
6
6
  import { requests } from '../../../api';
7
7
  import useDebounce from '../../../hooks/useDebounce';
8
8
  const Context = createContext({});
9
+ const maxTimeoutTime = 2147483647;
9
10
  export const AuthProvider = ({ children }) => {
10
11
  const [user, setUser] = useState();
11
12
  const [tokenInMemory, setTokenInMemory] = useState();
@@ -89,7 +90,7 @@ export const AuthProvider = ({ children }) => {
89
90
  if (remainingTime > 0) {
90
91
  reminder = setTimeout(() => {
91
92
  openModal('stay-logged-in');
92
- }, ((remainingTime - 60) * 1000));
93
+ }, (Math.min((remainingTime - 60) * 1000), maxTimeoutTime));
93
94
  }
94
95
  return () => {
95
96
  if (reminder)
@@ -105,7 +106,7 @@ export const AuthProvider = ({ children }) => {
105
106
  setUser(null);
106
107
  push(`${admin}/logout-inactivity`);
107
108
  closeAllModals();
108
- }, remainingTime * 1000);
109
+ }, Math.min(remainingTime * 1000, maxTimeoutTime));
109
110
  }
110
111
  return () => {
111
112
  if (forceLogOut)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payload",
3
- "version": "0.18.2",
3
+ "version": "0.18.3",
4
4
  "description": "Node, React and MongoDB Headless CMS and Application Framework",
5
5
  "license": "MIT",
6
6
  "author": {