NOTE: This controls channel membership, not API access. Returning false
won't block the request, it just stops the customer from bein assigned to this channel.
(This is skipped on the default channel and during registration/checkout).
Example
This is configured via the authOptions.customerChannelAssignmentStrategy property of your
VendureConfig.
InjectableStrategy(ctx: RequestContext, customer: Customer, channelId: ID) => boolean | Promise<boolean>Return true to assign the Customer to the current Channel,
or false to let them use it for this session without assigning.
Triggered when an authenticated Customer's request targets a different Channel than the one currently active on their session. This doesn't run on the default Channel or if the Customer is already a member of the Channel.
The default CustomerChannelAssignmentStrategy: a Customer is auto-assigned to whichever Channel they authenticate against.
CustomerChannelAssignmentStrategyArchitecture reviews, custom plugin work, migrations, ongoing support. Get a hand from the team that builds Vendure.
Talk to the team