-
Notifications
You must be signed in to change notification settings - Fork 143
Description
Severity: High
- Blocks core functionality for users with multiple organizations.
- Prevents access to critical data or workflows tied to other accounts.
Describe the bug
When a user attempts to switch between organizations (e.g., from unijaychie to jaychiex) on the Organization Settings page, the Switch button appears enabled but does not function. This prevents users from accessing their other organization.
To Reproduce
Steps to reproduce the behavior:
- Navigate to https://app.aixblock.io/user/account.
- Log in with an account that has multiple organizations (e.g., unijaychie and jaychiex).
- Select the Switch button for the jaychiex organization.
- Observe that the button is enabled but does not switch to the selected organization.
Expected behavior
Clicking the Switch button should activate the selected organization (e.g., jaychiex) and update the user’s active context.
Screenshots

AIxBlock.-.Google.Chrome.2025-09-04.07-55-54.mp4
Desktop (please complete the following information):
OS: Windows 11
Browser Chrome
Version v139.0.7258.139
Additional context
Users cannot switch between organizations, requiring manual logout/login to access other accounts.
Suggested Fix
Frontend Fix:
Ensure the Switch button triggers the correct API call to update the active organization.
Example fix (JavaScript):
javascript
const handleSwitchOrganization = async (orgId) => {
try {
const response = await fetch('/api/switch-organization', {
method: 'POST',
body: JSON.stringify({ organizationId: orgId }),
});
if (response.ok) {
// Update UI to reflect the new organization
setOrganization(orgId);
} else {
alert("Failed to switch organization. Please try again.");
}
} catch (error) {
console.error("Switch organization error:", error);
alert("An unexpected error occurred.");
}
};
Backend Fix (if applicable):
Ensure the /api/switch-organization endpoint correctly processes the request and updates the user’s active organization in the database.