Преглед на файлове

fix(syncing-server): calling auth server for user key params

Karol Sójko преди 1 година
родител
ревизия
51ca8229b8

+ 1 - 1
packages/syncing-server/src/Domain/Auth/AuthHttpServiceInterface.ts

@@ -1,5 +1,5 @@
 import { KeyParamsData } from '@standardnotes/responses'
 
 export interface AuthHttpServiceInterface {
-  getUserKeyParams(dto: { email?: string; uuid?: string; authenticated: boolean }): Promise<KeyParamsData>
+  getUserKeyParams(userUuid: string): Promise<KeyParamsData>
 }

+ 1 - 4
packages/syncing-server/src/Domain/Handler/EmailBackupRequestedEventHandler.ts

@@ -42,10 +42,7 @@ export class EmailBackupRequestedEventHandler implements DomainEventHandlerInter
   ): Promise<void> {
     let authParams: KeyParamsData
     try {
-      authParams = await this.authHttpService.getUserKeyParams({
-        uuid: event.payload.userUuid,
-        authenticated: false,
-      })
+      authParams = await this.authHttpService.getUserKeyParams(event.payload.userUuid)
     } catch (error) {
       this.logger.error(
         `Could not get user key params from auth service for user ${event.payload.userUuid}: ${

+ 2 - 3
packages/syncing-server/src/Infra/HTTP/AuthHttpService.ts

@@ -9,15 +9,14 @@ export class AuthHttpService implements AuthHttpServiceInterface {
     private authServerUrl: string,
   ) {}
 
-  async getUserKeyParams(dto: { email?: string; uuid?: string; authenticated: boolean }): Promise<KeyParamsData> {
+  async getUserKeyParams(userUuid: string): Promise<KeyParamsData> {
     const keyParamsResponse = await this.httpClient.request({
       method: 'GET',
       timeout: 10000,
       headers: {
         Accept: 'application/json',
       },
-      url: `${this.authServerUrl}/users/params`,
-      params: dto,
+      url: `${this.authServerUrl}/users/params?uuid=${userUuid}`,
       validateStatus:
         /* istanbul ignore next */
         (status: number) => status >= 200 && status < 500,