Comments (3)
const Admin ={ email : process.env.EMAIL_OF_ADMIN || '[email protected]', password : process.env.PASSWORD_OF_ADMIN || 'coding' }; AdminBroExpressjs.buildAuthenticatedRouter(adminBro,{ authenticate:async(email, password)=>{ if (email === Admin.email && password === Admin.password) { return Admin } return null }, cookieName: process.env.COOKIE_ADMIN_NAME || 'C-4-P', cookiePassword: process.env.COOKIE_ADMIN_PASSWORD || 'admin-bro', }, adminRouter, { resave:true, saveUninitialized: true } );
I have passed the arguments like these but i still get the same errors
express-session deprecated undefined resave option; provide resave option node_modules\admin-bro-expressjs\plugin.js:131:14 express-session deprecated undefined saveUninitialized option; provide saveUninitialized option node_modules\admin-bro-expressjs\plugin.js:131:14 AdminBro: bundle ready
Thanks in Advance
You set it up wrong. Check here for correct way:
https://github.com/JSCasts-episodes/ep18-admin-bro-startup-part3
const router = buildAuthenticatedRouter(admin, {
cookieName: 'admin-bro',
cookiePassword: 'superlongandcomplicatedname',
authenticate: async (email, password) => {
const company = await Company.findOne({ email });
if (company && await argon2.verify(company.encryptedPassword, password)) {
return company.toJSON();
}
return null;
},
}, null, {
resave: false,
saveUninitialized: true,
});
from adminjs-expressjs.
https://softwarebrothers.github.io/admin-bro-dev/module-admin-bro-expressjs.html#.buildAuthenticatedRouter has sessionOptions - you can pass resave
and saveUninitialized
there.
from adminjs-expressjs.
const Admin ={
email : process.env.EMAIL_OF_ADMIN || '[email protected]',
password : process.env.PASSWORD_OF_ADMIN || 'coding'
};
AdminBroExpressjs.buildAuthenticatedRouter(adminBro,{
authenticate:async(email, password)=>{
if (email === Admin.email && password === Admin.password) {
return Admin
}
return null
},
cookieName: process.env.COOKIE_ADMIN_NAME || 'C-4-P',
cookiePassword: process.env.COOKIE_ADMIN_PASSWORD || 'admin-bro',
},
adminRouter,
{
resave:true,
saveUninitialized: true
}
);
I have passed the arguments like these but i still get the same errors
express-session deprecated undefined resave option; provide resave option node_modules\admin-bro-expressjs\plugin.js:131:14
express-session deprecated undefined saveUninitialized option; provide saveUninitialized option node_modules\admin-bro-expressjs\plugin.js:131:14
AdminBro: bundle ready
Thanks in Advance
from adminjs-expressjs.
Related Issues (20)
- Logging in no longer redirects to previous page
- TypeError: AdminJSExpress.buildAuthenticatedRouter is not a function HOT 3
- Changing the root path breaks login redirect HOT 2
- AdminJS Mongoose is not working with Typescript
- Redirect to previously visited page after login HOT 2
- There is no documentation or way how to redirect to custom Login page HOT 1
- rootPath as slash causes endless redirect loop HOT 1
- Option to use cookie-session. HOT 1
- Unable to use nestjs and admin-bro in the same app due to body-parser and formidable. HOT 2
- Don't redirect using POST on login HOT 2
- Boot timeout - Deploy to Heroku HOT 1
- missing tslib dependency
- buildAuthenticatedRouter not working correctly in 4.0.2 HOT 1
- Typescript import does not work as intended HOT 1
- Library not working with @4.1.0 for some reason HOT 1
- Passing query params makes requests bypass the auth check HOT 8
- Trailing slash on rootPath not taken into account by authentication
- express-session deprecated pass resave option HOT 1
- If `auth.authenticate` throws error whole app crashes
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from adminjs-expressjs.