title: "express-session deprecated undefined resave option; provide resave option node_modules/admin-bro-expressjs/plugin.js:138:14"
body: <p>am using admin-bro for my admin , it works fine until i try to use its authentication, when i try to login to the admin using the admin-bro login form dashboard ,it just keeps loading with no response,my terminal says </p>
  
  <blockquote>
    <p>express-session deprecated undefined resave option; provide resave option node_modules/admin-bro-expressjs/plugin.js:138:14</p>
    
    <p>express-session deprecated undefined saveUninitialized option; provide saveUninitialized option node_modules/admin-bro-expressjs/plugin.js :138:14 AdminBro: bundle ready we're connected!</p>
  </blockquote>
  
  <p>here's my app.js file    </p>
  
  <pre><code>require('dotenv').config();
  
  const express = require('express');
  const engine = require('ejs-mate');
  const path = require('path');
  const favicon = require('serve-favicon');
  const logger = require('morgan');
  const cookieParser = require('cookie-parser');
  const passport = require('passport');
  const User = require('./models/user');
  //const formidableMiddleware = require('express-formidable');
  const session = require('express-session');
  const mongoose = require('mongoose');
  const methodOverride = require('method-override');
  // const seedPosts = require('./seeds');
  // seedPosts();
  
  // require routes
  const index     = require('./routes/index');
  const posts     = require('./routes/posts');
  const reviews = require('./routes/reviews');
  const adminRouter= require('./routes/admin.router');
  
  const app = express();
  
  //connect to database
  //var url = process.env.DATABASEURL || "mongodb://localhost:27017/surf-shop"
  mongoose.connect("mongodb://localhost:27017/surf-shop" , {
      useNewUrlParser: true,
      useUnifiedTopology: true,
      useCreateIndex: true
  });
  
  const db = mongoose.connection;
  db.on('error', console.error.bind(console, 'connection error:'));
  db.once('open', () =&gt; {
    console.log('we\'re connected!');
  });
  
  // use ejs-locals for all ejs templates:
  app.engine('ejs', engine);
  // view engine setup
  app.set('views', path.join(__dirname, 'views'));
  app.set('view engine', 'ejs');
  // set public assets directory
  app.use(express.static('public'));
  
  //app.use(favicon(path.join(__dirname, 'public', 'favi.jpg')));
  app.use(logger('dev'));
  app.use(express.json());
  app.use(express.urlencoded({ extended: true }));
  app.use(cookieParser());
  app.use(express.static(path.join(__dirname, 'public')));
  app.use(methodOverride('_method'));
  
  // Configure Passport and Sessions
  app.use(session({
    secret: 'hang ten dude!',
    resave: false,
    saveUninitialized: true
  }));
  
  app.use(passport.initialize());
  app.use(passport.session());
  
  passport.use(User.createStrategy());
  passport.serializeUser(User.serializeUser());
  passport.deserializeUser(User.deserializeUser());
  
  // set local variables middleware
  app.use(function(req, res, next) {
    // req.user = {
    //   // '_id' : '5bb27cd1f986d278582aa58c',
    //   // '_id' : '5bc521c0b142b6d7f7523406',
    //   '_id' : '5bfed10ad176f845e38aec92',
    //   'username' : 'ian3'
    // }
    res.locals.currentUser = req.user;
    // set default page title
    res.locals.title = 'Surf Shop';
    // set success flash message
    res.locals.success = req.session.success || '';
    delete req.session.success;
    // set error flash message
    res.locals.error = req.session.error || '';
    delete req.session.error;
    // continue on to next function in middleware chain
    next();
  });
  
  // Mount routes
  app.use('/', index);
  app.use('/posts', posts);
  app.use('/posts/:id/reviews', reviews);
  app.use('/admin', adminRouter);
  
  //app.use(formidableMiddleware());
  
  
  // catch 404 and forward to error handler
  app.use(function(req, res, next) {
    const err = new Error('Not Found');
    err.status = 404;
    next(err);
  });
  
  // error handler
  app.use(function(err, req, res, next) {
    // // set locals, only providing error in development
    // res.locals.message = err.message;
    // res.locals.error = req.app.get('env') === 'development' ? err : {};
  
    // // render the error page
    // res.status(err.status || 500);
    // res.render('error');
    console.log(err);
    req.session.error = err.message;
    res.redirect('back');
  });
  
  module.exports = app;
  </code></pre>
  
  <p>here's my admin.route.js file</p>
  
  <pre><code>const AdminBro = require('admin-bro');
  const AdminBroExpress = require('admin-bro-expressjs');
  const AdminBroMongoose = require('admin-bro-mongoose');
  
  const mongoose = require('mongoose');
  
  AdminBro.registerAdapter(AdminBroMongoose);
  
  const adminBro = new AdminBro({
    databases: [mongoose], 
    rootPath: '/admin',
  });
  
  const ADMIN = {
    email: process.env.ADMIN_EMAIL || 'admin@example.com',
    password: process.env.ADMIN_PASSWORD || 'lovejs',
  }
  
  const router = AdminBroExpress.buildAuthenticatedRouter(adminBro, {
      cookieName: process.env.ADMIN_COOKIE_NAME || 'admin-bro',
      cookiePassword: process.env.ADMIN_COOKIE_PASS || 'some-super-sensitive-password',
      authenticate: async (email, password) =&gt; {
      if (ADMIN.password === password &amp;&amp; ADMIN.email === email) {
        return ADMIN
      }
      return null
  
      }
  });
  
  module.exports = router;
  </code></pre>
  
  <p>any help would be appreciated</p>