End script if login fails

pull/81/head
MillenniumEarl 2021-03-05 11:20:25 +01:00
parent 96074fbeb9
commit 40d13f25de
1 changed files with 6 additions and 0 deletions

View File

@ -65,6 +65,12 @@ async function main() {
); );
console.log(`Authentication result: ${result.message}\n`); console.log(`Authentication result: ${result.message}\n`);
// Manage failed login
if (!result.success) {
console.log("Failed authentication, impossible to continue");
return;
}
// Get user data // Get user data
console.log("Fetching user data..."); console.log("Fetching user data...");
const userdata = await getUserData(); const userdata = await getUserData();