Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Re: issue #27
Allow the tenantId to be optional.
Added
forceCheck
to the module options (default false) to state if the tenant should be checked on initialisation or not.Added an TenantGuard to be able to specify if a route needs a tenant or not.
Notes:
Validator will not run if
forceCheck
is false and tenantId isn't defined.TENANT_CONTEXT or other provided tokens may be undefined if the tenant isn't specified, so protect against them / sanity check them.
use the guard with:
@UseGuards(TenantGuard)