adminjs icon indicating copy to clipboard operation
adminjs copied to clipboard

I want to change the rootPath.

Open wngus606 opened this issue 2 years ago • 2 comments

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

It works well when rootPath is "/admin", but it does not work when it is changed to "/api/admin".

Installed libraries and their versions

wngus606 avatar Jun 14 '22 13:06 wngus606

@wngus606 is this your full config? I checked just now and /api/admin works for me

dziraf avatar Jun 24 '22 10:06 dziraf

If you have problem with login, checkout loginPath and logoutPath

wirekang avatar Aug 02 '22 04:08 wirekang