Skip to content

Commit

Permalink
Fix login error handling
Browse files Browse the repository at this point in the history
When user enters an invalid username or password, the code doesn't exist the function and continues triggering exceptions when trying to extract a token that doesn't exists
  • Loading branch information
Gerard Chanekon authored and mulbc committed Mar 8, 2023
1 parent 1f41d4c commit 130f6a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion options.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ async function authToVault(
${vaultServer}/v1/auth/${authMethod}/login/${username}<br>
Please check if your username, password and mountpoints are correct.
`);
new Error(`authToVault: ${await loginToVault.text}`);
return;
}
const authinfo = (await loginToVault.json()).auth;
const token = authinfo.client_token;
Expand Down

0 comments on commit 130f6a2

Please sign in to comment.