From fa1a7037b47f2e0114d8abc5a99d29239bd3637b Mon Sep 17 00:00:00 2001 From: Kristóf Marussy Date: Sun, 10 Jul 2022 16:07:45 +0200 Subject: refactor: local server import/export MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kristóf Marussy --- src/api/server/ServerApi.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/api/server/ServerApi.ts') diff --git a/src/api/server/ServerApi.ts b/src/api/server/ServerApi.ts index 77a759b3e..8b551ade2 100644 --- a/src/api/server/ServerApi.ts +++ b/src/api/server/ServerApi.ts @@ -25,7 +25,7 @@ import { SERVER_NOT_LOADED } from '../../config'; import { userDataRecipesPath, userDataPath } from '../../environment-remote'; import { asarRecipesPath } from '../../helpers/asar-helpers'; import apiBase from '../apiBase'; -import { prepareAuthRequest, sendAuthRequest } from '../utils/auth'; +import { prepareAuthRequest, prepareLocalToken, sendAuthRequest } from '../utils/auth'; import { getRecipeDirectory, @@ -246,6 +246,8 @@ export default class ServerApi { delete requestData.headers['Content-Type']; + await prepareLocalToken(requestData); + const request = await window.fetch( `${apiBase()}/service/${serviceId}`, // @ts-expect-error Argument of type '{ method: string; } & { mode: string; headers: any; }' is not assignable to parameter of type 'RequestInit | undefined'. -- cgit v1.2.3-54-g00ecf