Closed mariusa closed 2 years ago
Also interested on this topic We made a workaround, where we have a route "/auth" which returns our needed additional Data.
you can use Declaration Merging from the Request interface. these are some case examples.
That is not possible right now and will likely not be possible before 2.0, which will probably contain some breaking changes as well.
Right now, your best way to do that would probably be to have another middleware that is applied after express-basic-auth
which reads the auth
field, gets whatever additional info you need and adds it to the request in any way you want. If your authorizer and that middleware both need to run the same DB query on the same object, DB caching / some dataloader will probably make it so you do not feel any measurable performance impact.
Hi,
Thanks for this module!
In
myAsyncAuthorizer()
we load some data about that user. We'd like to pass that data forward to be available inreq.auth
for further use in the authenticated route.How to accomplish this, please? There's no mention in the README.