fix(console): fix self-management without explicit roles (#11583)

# Which Problems Are Solved

The self-management of user without any permissions in Console was no
longer possible and the UI was completely stuck.
This was due to the method `getActiveOrg`, which returned an error in
case no organization could be retrieved.

# How the Problems Are Solved

- Return `undefined` in case no organization is found and handle cases
where an organization is required.
- Redirect the user to `/users/me` if no organization is retrieved on
the start
- Prevent users without roles to access the home page

# Additional Changes

None

# Additional Context

closes #11567
This commit is contained in:
Livio Spring
2026-02-13 10:11:23 +01:00
committed by GitHub
parent 9b064d8b74
commit 5b8ba90295
6 changed files with 53 additions and 33 deletions
@@ -197,7 +197,7 @@ export class GrpcAuthService {
return this.grpcService.auth.listMyMetadata(req, null).then((resp) => resp.toObject());
}
public async getActiveOrg(id?: string): Promise<Org.AsObject> {
public async getActiveOrg(id?: string): Promise<Org.AsObject | undefined> {
if (id) {
const find = this.cachedOrgs.getValue().find((tmp) => tmp.id === id);
if (find) {
@@ -249,7 +249,7 @@ export class GrpcAuthService {
if (orgs.length === 0) {
this._activeOrgChanged.next(undefined);
return Promise.reject(new Error('No organizations found!'));
return undefined;
}
const orgToSet = orgs.find((element) => element.id !== '0' && element.name !== '');