fix: Create Human V1 (#9425)

# Which Problems Are Solved
- Correctly load Avatar on first load

# How the Problems Are Solved
- The Avatar issue was mostly due to how we resolved the current user, I
changed this behaviour

# Additional Changes
- Removed V2 create human code till seperate page is finished
- Remove Console Use V2 API feature flag from features page (till new
page is added)

# Additional Context
- Partially fixes #9382
- This will get implemented next week
https://github.com/zitadel/zitadel/issues/9382#issuecomment-2681347477
This commit is contained in:
Ramon
2025-02-27 09:31:48 +01:00
committed by GitHub
parent 3c471944c2
commit 83614562a2
9 changed files with 42 additions and 303 deletions
+8 -18
View File
@@ -164,24 +164,14 @@ export class GrpcAuthService {
shareReplay({ refCount: true, bufferSize: 1 }),
);
this.user = forkJoin([
defer(() => of(this.oauthService.getAccessToken())),
this.oauthService.events.pipe(
filter((e) => e.type === 'token_received'),
timeout(this.oauthService.waitForTokenInMsec ?? 0),
catchError((err) => {
if (err instanceof TimeoutError) {
return of(null);
}
throw err;
}), // timeout is not an error
map((_) => this.oauthService.getAccessToken()),
),
]).pipe(
filter(([_, token]) => !!token),
distinctUntilKeyChanged(1),
switchMap(() => this.getMyUser().then((resp) => resp.user)),
startWith(undefined),
this.user = this.oauthService.events.pipe(
filter((e) => e.type === 'token_received'),
map(() => this.oauthService.getAccessToken()),
startWith(this.oauthService.getAccessToken()),
filter(Boolean),
distinctUntilChanged(),
switchMap(() => this.getMyUser()),
map((user) => user.user),
shareReplay({ refCount: true, bufferSize: 1 }),
);