Skip to content

Commit 814bb82

Browse files
committed
Changed the condition for secret addition in config
1 parent fe2ff14 commit 814bb82

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

  • packages/contentstack-config/src/commands/config/mfa

packages/contentstack-config/src/commands/config/mfa/add.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,12 @@ export default class AddMFACommand extends BaseCommand<typeof AddMFACommand> {
2121

2222
async run(): Promise<void> {
2323
try {
24-
// Check for environment variable first
2524
const envSecret = process.env.CONTENTSTACK_MFA_SECRET;
2625
if (envSecret && !this.mfaService.validateSecret(envSecret)) {
27-
cliux.error('Invalid secret format in environment variable. The secret must be a valid Base32 string of at least 16 characters.');
28-
cliux.print('For more information about MFA, visit: https://www.contentstack.com/docs/developers/security/multi-factor-authentication', { color: 'yellow' });
29-
process.exit(1);
30-
}
26+
cliux.error('Invalid secret format in environment variable. The secret must be a valid Base32 string of at least 16 characters.');
27+
cliux.print('For more information about MFA, visit: https://www.contentstack.com/docs/developers/security/multi-factor-authentication', { color: 'yellow' });
28+
process.exit(1);
29+
} else if (envSecret) {
3130
cliux.print('Using MFA secret from environment variable');
3231
return;
3332
}

0 commit comments

Comments
 (0)