Isolate tenant data through organization membership checks
Your workspace route creates an organization for each new customer workspace and makes the account that sends the request its owner. Before your code returns data from a workspace, it checks the user's membership with Auth, which grants access to the members of that organization alone, with the permissions of their roles.
Impact
The OrgSwitcher component in the sample shows the workspaces of the signed-in user and opens the one that the user picks. Auth keeps the record of which account belongs to which customer, so you will have no tenant table to maintain in your own database.
Prompt for a coding agent: Create an organization for each new workspace, and let users switch between their workspaces.
Select a file to view its contents