Files
standardnotes-server/packages/syncing-server/src/Infra/HTTP/AuthHttpService.ts
T
Karol SójkoandGitHub d13c975f94 chore: upgrade deps (#805)
* chore: upgrade semver

* chore: upgrade configure-aws-credentials@v2

* chore: upgrade prettier deps

* fix: linter issues
2023-09-01 16:14:51 +02:00

28 lines
839 B
TypeScript

import { KeyParamsData } from '@standardnotes/responses'
import { AxiosInstance } from 'axios'
import { AuthHttpServiceInterface } from '../../Domain/Auth/AuthHttpServiceInterface'
export class AuthHttpService implements AuthHttpServiceInterface {
constructor(
private httpClient: AxiosInstance,
private authServerUrl: string,
) {}
async getUserKeyParams(dto: { email?: string; uuid?: string; authenticated: boolean }): Promise<KeyParamsData> {
const keyParamsResponse = await this.httpClient.request({
method: 'GET',
headers: {
Accept: 'application/json',
},
url: `${this.authServerUrl}/users/params`,
params: dto,
validateStatus:
/* istanbul ignore next */
(status: number) => status >= 200 && status < 500,
})
return keyParamsResponse.data
}
}