fix: auth in cli (#6675)

* fix: auth in cli

* fixes
This commit is contained in:
naman-bruno
2026-01-05 22:06:26 +05:30
committed by GitHub
parent a3809ce4b9
commit 8300abe086
2 changed files with 11 additions and 8 deletions

View File

@@ -288,13 +288,16 @@ const prepareRequest = async (item = {}, collection = {}) => {
request.body = request.body || {};
if (request.body.mode === 'json') {
if (!contentTypeDefined) {
axiosRequest.headers['content-type'] = 'application/json';
}
try {
axiosRequest.data = decomment(request?.body?.json);
} catch (error) {
axiosRequest.data = request?.body?.json;
const jsonBody = request.body.json;
if (jsonBody && jsonBody.length > 0) {
if (!contentTypeDefined) {
axiosRequest.headers['content-type'] = 'application/json';
}
try {
axiosRequest.data = decomment(jsonBody);
} catch (error) {
axiosRequest.data = jsonBody;
}
}
}

View File

@@ -193,7 +193,7 @@ export const toBrunoAuth = (auth: Auth | null | undefined): BrunoAuth | null =>
case 'bearer':
brunoAuth.mode = 'bearer';
brunoAuth.bearer = {
token: auth.token || null
token: auth.token || ''
};
break;