mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-13 09:25:12 +00:00
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:
@@ -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 !== '');
|
||||
|
||||
Reference in New Issue
Block a user