From 135570d38415d10ba74c43df6ea07f54ca4c0951 Mon Sep 17 00:00:00 2001 From: Polianin Nikita Date: Mon, 23 Dec 2024 06:45:19 +0300 Subject: [PATCH] fix: redesign the service for a new api --- src/api/v1/authApiService.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/api/v1/authApiService.ts b/src/api/v1/authApiService.ts index 249325a..c8054a4 100644 --- a/src/api/v1/authApiService.ts +++ b/src/api/v1/authApiService.ts @@ -5,6 +5,8 @@ import {catchError, map, Observable, of} from "rxjs"; import {AuthRoles} from "@model/authRoles"; import {AvailableOAuthProvidersResponse} from "@api/v1/availableProvidersResponse"; import {OAuthProvider} from "@model/oAuthProvider"; +import {TwoFactorAuthentication} from "@model/twoFactorAuthentication"; +import {TwoFactorAuthRequest} from "@api/v1/twoFactorAuthRequest"; export interface OAuthProviderData extends AvailableOAuthProvidersResponse { icon: string; @@ -22,7 +24,17 @@ export default class AuthApiService extends ApiService { .setWithCredentials() .build; - return this.post(request); + return this.post(request); + } + + public twoFactorAuth(data: TwoFactorAuthRequest) { + let request = this.createRequestBuilder() + .setEndpoint('2FA') + .setData(data) + .setWithCredentials() + .build; + + return this.post(request); } public reLogin() {