question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The PasswordAuthStrategy defaults cannot be used in production

See original GitHub issue

When you add a PasswordAuthStrategy you get a warning in the console:

Connecting to databaseWarning: connect.session() MemoryStore is not designed for a production environment, as it will leak memory, and will not scale past a single process.

This is because of express session: https://github.com/expressjs/session/blob/master/README.md#compatible-session-stores

Looks like there are a bunch of better defaults we could use? Are there good docs on how to customise this?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
gautamsicommented, Aug 1, 2019

This is what I did to use mongodb based Store

const session = require('express-session');
const MongoStore = require('connect-mongo')(session);
const sessionStore = new MongoStore({url: CONNECT_TO});
// ......

module.exports = {
  keystone,
  apps: [
    new GraphQLApp({ sessionStore }),
    new StaticApp({ .... }),
    adminApp,
    new NextApp({ .... }),
  ],
};
0reactions
leobar37commented, Jan 24, 2021
const sessionExpress = require("express-session");
const knexSesionStore = require("connect-session-knex")(sessionExpress);


 const app = new Keystone({
      secureCookies: false,
      adapter: this.bdAdapter(),
      sessionStore: new knexSesionStore({
        tablename: "sesions",
        knex: knex(configKnex),
      })
 });,
``
Read more comments on GitHub >

github_iconTop Results From Across the Web

keystonejs/keystone - Gitter
hi everbody, i have a nextjs wrbsite with keystoneJS, a user list with PasswordAuthStrategy, i use the GraphQL mutation signin in my nextjs...
Read more >
Deployed to Heroku, admin UI login suddenly stops working
In production, this needs to be set in the Keystone constructor by passing in a key-value pair of "session store": <Session Store> as...
Read more >
Fix checkbox field layout by JedWatson · Pull Request #2616 ...
This has been bugging me for a while... Checkbox input fields are pretty terrible to use because the label and checkbox are broken...
Read more >
The keystone-5 from keystonejs - GithubHelp
can't get /admin in production - admin-ui-app ... Should there not be a command to override the default summary or label field keystone...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found