From 1acc846e8c7aec74d09cf260adb8d968a58c133d Mon Sep 17 00:00:00 2001 From: Mark Rajcok Date: Fri, 26 Jan 2018 10:29:05 -0500 Subject: [PATCH] fix login.html JavaScript Move else clauses out of the success handler function and into the main function where they belong. --- Lesson2/step4/templates/login.html | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/Lesson2/step4/templates/login.html b/Lesson2/step4/templates/login.html index a454d42..7f66367 100644 --- a/Lesson2/step4/templates/login.html +++ b/Lesson2/step4/templates/login.html @@ -55,18 +55,16 @@ setTimeout(function() { window.location.href = "/restaurant"; }, 4000); - - - } else if (authResult['error']) { + } + } + }); + } else if (authResult['error']) { console.log('There was an error: ' + authResult['error']); } else { - $('#result').html('Failed to make a server-side call. Check your configuration and console.'); - } - - } - - }); } } + $('#result').html('Failed to make a server-side call. Check your configuration and console.'); + } +}