mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-03 21:02:15 +00:00
# Which Problems Are Solved Solves #8976 # Additional Changes I have done some intensive refactorings and we are using the new @zitadel/client package for GRPC access. # Additional Context - Closes #8976 --------- Co-authored-by: Max Peintner <[email protected]>
31 lines
981 B
TypeScript
31 lines
981 B
TypeScript
import { Injectable } from '@angular/core';
|
|
import { GrpcService } from './grpc.service';
|
|
import { create } from '@bufbuild/protobuf';
|
|
import {
|
|
AddMyAuthFactorOTPSMSRequestSchema,
|
|
AddMyAuthFactorOTPSMSResponse,
|
|
GetMyUserRequestSchema,
|
|
GetMyUserResponse,
|
|
VerifyMyPhoneRequestSchema,
|
|
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(create(GetMyUserRequestSchema));
|
|
}
|
|
|
|
public verifyMyPhone(code: string): Promise<VerifyMyPhoneResponse> {
|
|
return this.grpcService.authNew.verifyMyPhone(create(VerifyMyPhoneRequestSchema, { code }));
|
|
}
|
|
|
|
public addMyAuthFactorOTPSMS(): Promise<AddMyAuthFactorOTPSMSResponse> {
|
|
return this.grpcService.authNew.addMyAuthFactorOTPSMS(create(AddMyAuthFactorOTPSMSRequestSchema));
|
|
}
|
|
}
|