Skip to content

Commit b2c4467

Browse files
authored
Merge pull request #3 from CodeAnt-AI/feat/set-telemetry
login v2
2 parents 1fc6d3a + 06d5747 commit b2c4467

File tree

9 files changed

+15
-12
lines changed

9 files changed

+15
-12
lines changed

changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
## [0.3.6] - 02/04/2026
4+
- new login approach
5+
36
## [0.3.5] - 01/04/2026
47
- Local secret detection
58

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codeant-cli",
3-
"version": "0.3.5",
3+
"version": "0.3.6",
44
"description": "Code review CLI tool",
55
"type": "module",
66
"bin": {

src/commands/login.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default function Login() {
1414

1515
useEffect(() => {
1616
// Check if already logged in
17-
const existingToken = getConfigValue('apiKey');
17+
const existingToken = getConfigValue('apiKeyV2');
1818
if (existingToken) {
1919
setStatus('already_logged_in');
2020
setTimeout(() => exit(), 100);
@@ -48,7 +48,7 @@ export default function Login() {
4848
clearTimeout(timeoutId);
4949

5050
// Save the API key
51-
setConfigValue('apiKey', token);
51+
setConfigValue('apiKeyV2', token);
5252

5353
setStatus('success');
5454
setTimeout(() => exit(), 100);

src/commands/logout.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ import { getConfigValue, setConfigValue } from '../utils/config.js';
55
export default function Logout() {
66
const { exit } = useApp();
77

8-
const wasLoggedIn = !!getConfigValue('apiKey');
8+
const wasLoggedIn = !!getConfigValue('apiKeyV2');
99

1010
useEffect(() => {
1111
if (wasLoggedIn) {
12-
setConfigValue('apiKey', null);
12+
setConfigValue('apiKeyV2', null);
1313
}
1414
exit();
1515
}, []);

src/commands/review.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default function Review({ scanType = 'all', lastNCommits = 1, failOn = 'C
3131
const [fileCount, setFileCount] = useState(0);
3232
const [reviewMeta, setReviewMeta] = useState(null);
3333

34-
const apiKey = getConfigValue('apiKey');
34+
const apiKey = getConfigValue('apiKeyV2');
3535

3636
useEffect(() => {
3737
if (!apiKey) {

src/reviewHeadless.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ export async function runReviewHeadless(options = {}) {
8787
} = options;
8888

8989
// If the CLI config doesn't have an apiKey but the extension passed one, persist it
90-
if (apiKey && !getConfigValue('apiKey')) {
91-
setConfigValue('apiKey', apiKey);
90+
if (apiKey && !getConfigValue('apiKeyV2')) {
91+
setConfigValue('apiKeyV2', apiKey);
9292
}
9393

9494
// Temporarily set env vars so fetchApi picks them up

src/utils/analytics.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function getClient() {
2424

2525
/** Use the API key directly as distinct ID */
2626
function getDistinctId() {
27-
return process.env.CODEANT_API_TOKEN || getConfigValue('apiKey') || 'anonymous';
27+
return process.env.CODEANT_API_TOKEN || getConfigValue('apiKeyV2') || 'anonymous';
2828
}
2929

3030
/**

src/utils/fetchApi.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const fetchApi = async (endpoint, method = 'GET', body = null) => {
1212
};
1313

1414
// Add auth token from config or env
15-
const token = process.env.CODEANT_API_TOKEN || getConfigValue('apiKey');
15+
const token = process.env.CODEANT_API_TOKEN || getConfigValue('apiKeyV2');
1616
if (token) {
1717
options.headers['Authorization'] = `Bearer ${token}`;
1818
}

0 commit comments

Comments
 (0)