Right now, the login callback is very lean and simple, receiving two arguments:
type LoginCallbackSignature = (op: Operation, user: ResourceAttributes) => boolean;
It is possible that more data is required to do a login operation, and that such data lives in other resources. Ideally we'd want to access Knex from here, but we need to resort to function factories to do so:
Since we already allow the UserProcessor to be customized, we should allow SessionProcessor and SessionResource as well. Processors extending from KnexProcessor have access to the service via this.knex.
Right now, the
login
callback is very lean and simple, receiving two arguments:It is possible that more data is required to do a login operation, and that such data lives in other resources. Ideally we'd want to access Knex from here, but we need to resort to function factories to do so:
Since we already allow the
UserProcessor
to be customized, we should allowSessionProcessor
andSessionResource
as well. Processors extending fromKnexProcessor
have access to the service viathis.knex
.Usage of the addon would then look like:
Such a processor would be defined as: