Methods
# static buildAuthenticatedRouter(admin, app, auth, predefinedRouteropt, formidableOptions) → {Router}
Builds regular koa router.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
admin |
AdminBro | AdminBro instance |
|
app |
Application | koa application created by |
|
auth |
KoaAuthOptions | authentication options |
|
predefinedRouter |
Router |
<optional> |
if you have any predefined router pass it here |
formidableOptions |
FormidableOptions | options passed to formidable module https://github.com/node-formidable/formidable#options |
@koa/router
# static buildRouter(admin, app, predefinedRouteropt, formidableOptions) → {Router}
Builds regular koa router.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
admin |
AdminBro | AdminBro instance |
|
app |
Application | koa application created by |
|
predefinedRouter |
Router |
<optional> |
if you have any predefined router pass it here |
formidableOptions |
FormidableOptions | options passed to formidable module https://github.com/node-formidable/formidable#options |
@koa/router
Type Definitions
# KoaAuthenticateFunction(email, password) → {Promise.<CurrentAdmin>}
An async authentication function, returning CurrentAdmin
Parameters:
Name | Type | Description |
---|---|---|
email |
string | email address passed in a form |
password |
string | Password passed in a form |
# KoaAuthOptions
Authentication options
Properties:
Name | Type | Description |
---|---|---|
authenticate |
KoaAuthenticateFunction | Function returning CurrentAdmin |