Skip to main content

IAdminForthRestAPI

Methods

processLoginCallbacks()

processLoginCallbacks(adminUser, toReturn, response, extra): Promise<void>

Called by login endpoint to process login callbacks. Also might be called by plugins, to prevent action if user is not allowed to login. For example signup or login via google might want to check if user is allowed to login by calling this method.

Parameters

ParameterTypeDescription
adminUserAdminUserplugin/af pases current adminUser
toReturnobjectthis is an object which will get status of login process. If at least one callback returns error or redirectTo, login process will be stopped (future callbacks will not be called).
toReturn.allowedLoginboolean-
toReturn.error?string-
toReturn.redirectTo?string-
responseanyhttp response object
extraHttpExtra-

Returns

Promise<void>


registerEndpoints()

registerEndpoints(server): void

Called by AdminForth to initialize all endpoints for REST API.

Parameters

ParameterType
serverIHttpServer

Returns

void