mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-07 07:16:54 +00:00
fix: load metadata using user service (#9429)
# Which Problems Are Solved - #9382 "When I log in and get to my user profile page, I get an empty error message at the top:" # How the Problems Are Solved load metadata using user service # Additional Changes - The roles observable returns an empty array instead of never emiting - Small refactorings in app.component.ts because at first I thought the errors stems from there. - Added withLatestFromSynchronousFix RXJS operator because withLatestFrom has confusing behavior when used in synchronous contexts. Why this operator is needed is described here: https://github.com/ReactiveX/rxjs/issues/7068 # Additional Context - Closes #9382
This commit is contained in:
@@ -1,12 +1,9 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { GrpcService } from './grpc.service';
|
||||
import { create } from '@bufbuild/protobuf';
|
||||
import {
|
||||
AddMyAuthFactorOTPSMSRequestSchema,
|
||||
AddMyAuthFactorOTPSMSResponse,
|
||||
GetMyUserRequestSchema,
|
||||
GetMyUserResponse,
|
||||
VerifyMyPhoneRequestSchema,
|
||||
ListMyMetadataResponse,
|
||||
VerifyMyPhoneResponse,
|
||||
} from '@zitadel/proto/zitadel/auth_pb';
|
||||
|
||||
@@ -17,14 +14,18 @@ export class NewAuthService {
|
||||
constructor(private readonly grpcService: GrpcService) {}
|
||||
|
||||
public getMyUser(): Promise<GetMyUserResponse> {
|
||||
return this.grpcService.authNew.getMyUser(create(GetMyUserRequestSchema));
|
||||
return this.grpcService.authNew.getMyUser({});
|
||||
}
|
||||
|
||||
public verifyMyPhone(code: string): Promise<VerifyMyPhoneResponse> {
|
||||
return this.grpcService.authNew.verifyMyPhone(create(VerifyMyPhoneRequestSchema, { code }));
|
||||
return this.grpcService.authNew.verifyMyPhone({});
|
||||
}
|
||||
|
||||
public addMyAuthFactorOTPSMS(): Promise<AddMyAuthFactorOTPSMSResponse> {
|
||||
return this.grpcService.authNew.addMyAuthFactorOTPSMS(create(AddMyAuthFactorOTPSMSRequestSchema));
|
||||
return this.grpcService.authNew.addMyAuthFactorOTPSMS({});
|
||||
}
|
||||
|
||||
public listMyMetadata(): Promise<ListMyMetadataResponse> {
|
||||
return this.grpcService.authNew.listMyMetadata({});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user