Koa
@adminjs/koa
Make sure you have installed AdminJS packages described in Getting started article.
To setup AdminJS panel with Koa you need to have koa
installed and required peer dependencies:
Afterwards, follow one of the examples below.
Simple
app.js
Authenticated
To add authentication, you must use AdminJSKoa.buildAuthenticatedRouter
instead of AdminJSKoa.buildRouter
.
app.js
As you may have noticed, the authenticate
function compares credentials you submit in the form with a hardcoded DEFAULT_ADMIN
object. In your case, you might want to modify authenticate
function's logic to compare form credentials against real database objects.
Last updated