Skip to content

Commit

Permalink
changed error codes based on code rabbit review
Browse files Browse the repository at this point in the history
  • Loading branch information
lelemm committed Dec 19, 2024
1 parent 39da3b1 commit c468d0f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/scripts/disable-openid.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
import { promptPassword } from '../util/prompt.js';

if (needsBootstrap()) {
console.log('System needs to be bootstrapped first. Please set up the server before managing OpenID.');
console.log('System needs to be bootstrapped first. OpenID is not enabled.');

process.exit(1);
} else {
Expand All @@ -17,7 +17,7 @@ if (needsBootstrap()) {

if (loginMethod === 'password') {
console.log('OpenID already disabled.');
process.exit(1);
process.exit(0);
}

const password = await promptPassword();
Expand All @@ -28,7 +28,7 @@ if (needsBootstrap()) {
console.log(
'Please report this as an issue: https://github.com/actualbudget/actual-server/issues',
);
process.exit(1);
process.exit(2);
}
console.log('OpenID disabled!');
console.log(
Expand All @@ -39,6 +39,6 @@ if (needsBootstrap()) {
console.log(
'Please report this as an issue: https://github.com/actualbudget/actual-server/issues',
);
process.exit(1);
process.exit(2);
}
}
8 changes: 4 additions & 4 deletions src/scripts/enable-openid.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if (needsBootstrap()) {
'It looks like you don’t have a password set yet. Password is the fallback authentication method when using OpenID. Execute the command reset-password before using this command!',
);

process.exit(-1);
process.exit(1);
} else {
console.log('Enabling openid based on Environment variables or config.json');
try {
Expand All @@ -19,7 +19,7 @@ if (needsBootstrap()) {

if (loginMethod === 'openid') {
console.log('OpenID already enabled.');
process.exit(1);
process.exit(0);
}
const { error } = (await enableOpenID(finalConfig)) || {};

Expand All @@ -28,7 +28,7 @@ if (needsBootstrap()) {
console.log(
'Please report this as an issue: https://github.com/actualbudget/actual-server/issues',
);
process.exit(1);
process.exit(2);
}
console.log('OpenID enabled!');
console.log(
Expand All @@ -39,6 +39,6 @@ if (needsBootstrap()) {
console.log(
'Please report this as an issue: https://github.com/actualbudget/actual-server/issues',
);
process.exit(1);
process.exit(2);
}
}

0 comments on commit c468d0f

Please sign in to comment.