properly sets user to null when logged out
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user