Agent Wranglers

ACC-47Recommended

Keep the organisation in the address

Put the organisation's ID or slug in every address inside it, such as /acme/invoices/42, and take the organisation for each request from the address.

How to do it

A shared link then opens in the right organisation, and two tabs can show two organisations. Never keep the current organisation only in the session or a cookie. When someone opens an address for an organisation they cannot see, answer 404. It follows the rule to keep screen state in the address.

How to check

Open organisation A in one tab and B in another, then create a record in each. Each record lands in the organisation of its own tab.

For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/accounts/organisations-and-teams/organisation-in-url">Agent Wranglers accounts and identity playbook</a>. In code you write, add a comment next to it with the same link.