fastify-auth
fastify-auth copied to clipboard
Configure default relation
Prerequisites
- [X] I have written a descriptive issue title
- [X] I have searched existing issues to ensure the feature has not already been requested
🚀 Feature Proposal
I'm looking to add some CASL authorisation to my routes and I thought it would be less verbose if I could set the default relationship as "and" instead of "or". That way I can run my authentication check first, then the authorisation check, without appending: { relation: 'and' } to every route.
Motivation
Less verbose if I never intend to use "or"
Example
app.register(require('@fastify/auth'), {
defaultRelation: 'and'
})
Thanks for reporting! Would you like to send a Pull Request to address this issue? Remember to add unit tests.
Resolved by #175