From b3c9f7f939f034667b2cf8ace385fc8b910561d9 Mon Sep 17 00:00:00 2001 From: Nate Sawant Date: Thu, 20 Jun 2024 01:58:57 -0400 Subject: [PATCH] Fix bug with invalid existing interceptor --- cli/src/endpoints/authAxios.ts | 2 ++ cli/src/utils/updateEnv.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cli/src/endpoints/authAxios.ts b/cli/src/endpoints/authAxios.ts index 9316f51..72a3db3 100644 --- a/cli/src/endpoints/authAxios.ts +++ b/cli/src/endpoints/authAxios.ts @@ -10,6 +10,8 @@ export const config = { }; export function SetCookie(credentials: string) { + axiosInstance.interceptors.request.clear(); + // Add a request interceptor to include the cookie in the headers axiosInstance.interceptors.request.use( (config) => { diff --git a/cli/src/utils/updateEnv.ts b/cli/src/utils/updateEnv.ts index cecf1f6..d3e537d 100644 --- a/cli/src/utils/updateEnv.ts +++ b/cli/src/utils/updateEnv.ts @@ -7,7 +7,7 @@ export default async function updateExistingEnvVariable( try { // Path to the .env file const filePath = ".env"; - const content = await readFile(filePath, { flag: "a+" }); + const content = await readFile(filePath); // Split the content into lines const lines = content.toString().split("\n");