mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-11 16:45:13 +00:00
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:
@@ -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 }),
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user