You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
classMySessionProcessor<TextendsSession>extendsJsonApiSessionProcessor<T>{publicstaticresourceClass=MySession;// extends Sessionprotectedasynclogin(op: Operation,userDataSource: ResourceAttributes): Promise<boolean>{// Do the login.}}
The text was updated successfully, but these errors were encountered:
joelalejandro
changed the title
Support for using a custom SessionProcessor in UserManagementAddon
Support for using a custom SessionProcessor and SessionUser in UserManagementAddon
Mar 13, 2023
joelalejandro
changed the title
Support for using a custom SessionProcessor and SessionUser in UserManagementAddon
Support for using a custom SessionProcessor and SessionResource in UserManagementAddon
Mar 13, 2023
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:
The text was updated successfully, but these errors were encountered: