mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-12 18:31:34 +00:00
Merge pull request #5030 from stupidly-logical/fix/gen_code_auth_header
fix: Add null check for collection root in snippet generator #5029
This commit is contained in:
@@ -27,7 +27,8 @@ const generateSnippet = ({ language, item, collection, shouldInterpolate = false
|
||||
|
||||
// Add auth headers if needed
|
||||
if (request.auth && request.auth.mode !== 'none') {
|
||||
const authHeaders = getAuthHeaders(collection.root.request.auth, request.auth);
|
||||
const collectionAuth = collection?.root?.request?.auth || null;
|
||||
const authHeaders = getAuthHeaders(collectionAuth, request.auth);
|
||||
headers = [...headers, ...authHeaders];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user