From 130f6a219b7faf8d85202dad01365243cb4cd5c0 Mon Sep 17 00:00:00 2001 From: Gerard Chanekon Date: Sun, 5 Mar 2023 18:28:25 +1100 Subject: [PATCH] Fix login error handling 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 --- options.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/options.js b/options.js index f00b5f9..e7df53f 100644 --- a/options.js +++ b/options.js @@ -220,7 +220,7 @@ async function authToVault( ${vaultServer}/v1/auth/${authMethod}/login/${username}
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;