Skip to content

Commit c40c48f

Browse files
committed
fix: enhance ENABLE_AUTH env var
1 parent 9a08ce9 commit c40c48f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/config/constants.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@ export const GIT_OUTPUT_FORMAT = `"${['%h', '%an', '%ad'].join('|')}"`;
1010
export const DEFAULT_DATE_FORMAT = 'yyyy-MM-dd';
1111
export const DEFAULT_DATE_COMMIT_FORMAT = 'MM/dd/yyyy, h:mm:ss a';
1212
export const DEFAULT_DATE_COMMIT_MONTH_FORMAT = 'MMMM yyyy';
13-
export const ENABLE_AUTH = true;
13+
export const ENABLE_AUTH = false;
14+
15+
const toBoolean = (value: string | undefined): boolean | undefined => {
16+
if (value === 'true') return true;
17+
if (value === 'false') return false;
18+
return undefined;
19+
};
1420

1521
let concurrentPageRequests = CONCURRENT_PAGE_REQUESTS;
1622
const parsed = Number.parseInt(process.env.CONCURRENT_PAGE_REQUESTS ?? '0', 10);
@@ -29,7 +35,7 @@ export const config = {
2935
graphqlHost: process.env.GRAPHQL_HOST || GRAPHQL_HOST,
3036
graphqlPath: process.env.GRAPHQL_PATH || GRAPHQL_PATH,
3137
analyticsUrl: process.env.ANALYTICS_URL || ANALYTICS_URL,
32-
enableAuth: process.env.ENABLE_AUTH || ENABLE_AUTH,
38+
enableAuth: toBoolean(process.env.ENABLE_AUTH) ?? ENABLE_AUTH,
3339
concurrentPageRequests,
3440
pageSize,
3541
};

0 commit comments

Comments
 (0)