From 40d13f25de79bfbd930e980397bfbbcbecca7fd6 Mon Sep 17 00:00:00 2001 From: MillenniumEarl Date: Fri, 5 Mar 2021 11:20:25 +0100 Subject: [PATCH] End script if login fails --- src/example.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/example.ts b/src/example.ts index 42565ed..c54ce1e 100644 --- a/src/example.ts +++ b/src/example.ts @@ -65,6 +65,12 @@ async function main() { ); console.log(`Authentication result: ${result.message}\n`); + // Manage failed login + if (!result.success) { + console.log("Failed authentication, impossible to continue"); + return; + } + // Get user data console.log("Fetching user data..."); const userdata = await getUserData();