mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-10 08:05:12 +00:00
# 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
32 lines
880 B
TypeScript
32 lines
880 B
TypeScript
import { Injectable } from '@angular/core';
|
|
import { GrpcService } from './grpc.service';
|
|
import {
|
|
AddMyAuthFactorOTPSMSResponse,
|
|
GetMyUserResponse,
|
|
ListMyMetadataResponse,
|
|
VerifyMyPhoneResponse,
|
|
} from '@zitadel/proto/zitadel/auth_pb';
|
|
|
|
@Injectable({
|
|
providedIn: 'root',
|
|
})
|
|
export class NewAuthService {
|
|
constructor(private readonly grpcService: GrpcService) {}
|
|
|
|
public getMyUser(): Promise<GetMyUserResponse> {
|
|
return this.grpcService.authNew.getMyUser({});
|
|
}
|
|
|
|
public verifyMyPhone(code: string): Promise<VerifyMyPhoneResponse> {
|
|
return this.grpcService.authNew.verifyMyPhone({});
|
|
}
|
|
|
|
public addMyAuthFactorOTPSMS(): Promise<AddMyAuthFactorOTPSMSResponse> {
|
|
return this.grpcService.authNew.addMyAuthFactorOTPSMS({});
|
|
}
|
|
|
|
public listMyMetadata(): Promise<ListMyMetadataResponse> {
|
|
return this.grpcService.authNew.listMyMetadata({});
|
|
}
|
|
}
|