adminjs
adminjs copied to clipboard
I want to change the rootPath.
Describe the bug
// app.js
app.use("/api/admin", adminRouter);
// router.js
const adminJs = new AdminJS({
rootPath: "/api/admin",
....
});
export const adminRouter = AdminJSExpress.buildAuthenticatedRouter(adminJs, {
authenticate: (email, password) => {
if (ADMIN.password === password && ADMIN.email === email) {
return ADMIN
}
return null
},
cookieName: 'admin',
cookiePassword: 'admin',
});
![image](https://user-images.githubusercontent.com/7146593/173593371-61128dea-6b23-4dd6-867a-6bc1d4931132.png)
It works well when rootPath is "/admin", but it does not work when it is changed to "/api/admin".
Installed libraries and their versions
- [email protected]
- @adminjs/[email protected]
- @adminjs/[email protected] ... mongo, express (whatever you think is relevant)
@wngus606 is this your full config? I checked just now and /api/admin
works for me
If you have problem with login, checkout loginPath
and logoutPath