diff --git a/demo/collections/Admin.js b/demo/collections/Admin.js index d883758f86..6c3b6b1b8b 100644 --- a/demo/collections/Admin.js +++ b/demo/collections/Admin.js @@ -20,7 +20,7 @@ module.exports = { admin: () => true, }, auth: { - tokenExpiration: 7200, + tokenExpiration: 7200, // 2 hours emailVerification: false, maxLoginAttempts: 5, lockTime: 600 * 1000, // lock time in ms diff --git a/src/client/components/providers/Authentication.js b/src/client/components/providers/Authentication.js index bbd447041f..6424226cf8 100644 --- a/src/client/components/providers/Authentication.js +++ b/src/client/components/providers/Authentication.js @@ -51,6 +51,7 @@ const AuthenticationProvider = ({ children }) => { const json = await request.json(); setUser(json.user); } else { + setUser(null); history.push(`${admin}/logout-inactivity`); } }, 1000); @@ -138,6 +139,7 @@ const AuthenticationProvider = ({ children }) => { if (remainingTime > 0) { forceLogOut = setTimeout(() => { + setUser(null); history.push(`${admin}/logout`); closeAllModals(); }, remainingTime * 1000); diff --git a/src/webpack/getWebpackDevConfig.js b/src/webpack/getWebpackDevConfig.js index 85915a9634..356abdbfc6 100644 --- a/src/webpack/getWebpackDevConfig.js +++ b/src/webpack/getWebpackDevConfig.js @@ -27,10 +27,11 @@ module.exports = (config) => { { test: /\.js$/, exclude: /node_modules\/(?!(@payloadcms\/payload)\/).*/, - use: [{ - loader: 'babel-loader', - options: babelConfig, - }, + use: [ + { + loader: 'babel-loader', + options: babelConfig, + }, // { // loader: 'eslint-loader', // options: {