Skip to content

fix: tenant switching#5

Merged
ontehfritz merged 2 commits intomainfrom
fix-account-details-view
Feb 4, 2026
Merged

fix: tenant switching#5
ontehfritz merged 2 commits intomainfrom
fix-account-details-view

Conversation

@ontehfritz
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings February 2, 2026 01:19
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors tenant handling to fix tenant switching by making API calls explicitly tenant-aware (per-request) and updating UI views/composables to react to tenant and navigation changes.

Changes:

  • Make ApiClient + BulwarkAuthAdminApi accept an explicit tenantId per request instead of relying on global client state.
  • Update account/role/permission views to pass the current tenant ID and to refetch data on tenant changes / navigation.
  • Improve tenant selection UX/state (error + retry, clear tenant state on logout) and update integration tests accordingly.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
src/views/RoleListView.vue Pass tenant ID into role listing API and refetch on route/tenant changes.
src/views/RoleDetailView.vue Make role detail tenant-aware; refetch on route/tenant changes; add load/reset logic.
src/views/RoleCreateView.vue Pass tenant ID into role creation API.
src/views/PermissionListView.vue Pass tenant ID into permission listing API and refetch on route/tenant changes.
src/views/PermissionDetailView.vue Make permission detail tenant-aware; refetch on route/tenant changes; add load/reset logic.
src/views/PermissionCreateView.vue Pass tenant ID into permission creation API.
src/views/AccountListView.vue Pass tenant ID into account listing API and refetch on route/tenant changes.
src/views/AccountDetailView.vue Make account detail and RBAC operations tenant-aware; refetch on route/tenant changes.
src/views/AccountCreateView.vue Use explicit target tenant ID instead of temporarily mutating global API tenant context.
src/composables/useTenant.ts Add tenant readiness/error state, retry, selection validation, and logout clearing hook.
src/composables/useAuth.ts Add logout callback hook; stop setting tenant context on the API client at login/init.
src/components/AppToolbar.vue Show tenant load errors + retry; guard tenant selection changes.
src/api/client.ts Remove global tenant state; inject tenant into URLs per request when provided.
src/api/bulwark.admin.ts Make account/role/permission endpoints accept an optional tenantId parameter.
src/api/tests/bulwark.spec.ts Update integration tests to pass tenant ID explicitly to tenant-scoped endpoints.
bulwarkadmin.env Allow localhost:3000 in CORS origins.
bulwark.test.env Allow localhost:3000 in CORS origins.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ontehfritz ontehfritz merged commit c06fff0 into main Feb 4, 2026
4 checks passed
github-actions bot pushed a commit that referenced this pull request Feb 4, 2026
## [1.0.4](v1.0.3...v1.0.4) (2026-02-04)

### Bug Fixes

* tenant switching ([#5](#5)) ([c06fff0](c06fff0))
@github-actions
Copy link

github-actions bot commented Feb 4, 2026

🎉 This PR is included in version 1.0.4 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants