diff options
| author | Kumar Priyansh <[email protected]> | 2019-06-09 19:44:47 +0530 |
|---|---|---|
| committer | Kumar Priyansh <[email protected]> | 2019-06-09 19:44:47 +0530 |
| commit | c6e8231b317c3104f49222b1628f2d7287de13a8 (patch) | |
| tree | 85cfa0c8904f115a1a8adfd1df60c6c96801111e /shared | |
| parent | d19e879609da765d2a9d74990e25ad1761216654 (diff) | |
| download | firebase-ecommerce-c6e8231b317c3104f49222b1628f2d7287de13a8.tar.xz firebase-ecommerce-c6e8231b317c3104f49222b1628f2d7287de13a8.zip | |
Login Functions Updated
Diffstat (limited to 'shared')
| -rw-r--r-- | shared/js/Login.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/shared/js/Login.js b/shared/js/Login.js index e1b9d3c..4726974 100644 --- a/shared/js/Login.js +++ b/shared/js/Login.js @@ -5,23 +5,26 @@ $(document).ready(function(){ $('.toast').toast('show') } $('#login').click(function(){ + $('#login').html(' <div class="spinner-grow spinner-grow-sm text-light" role="status"><span class="sr-only">Loading...</span></div> '); var email = $("#email").val() var password = $("#password").val() if(email === '' || password === '') { - showAlert('Error', 'Please fill in all the fields') + $('#login').html('Login') + showAlert('Sign in Error', 'Email or Password empty. You need to fill in all the details to continue with login. Please fill in all details and retry.') } else { firebase.auth().signInWithEmailAndPassword(email, password).catch(function(error) { + $('#login').html('Login') // Handle Errors here. var errorCode = error.code; var errorMessage = error.message; - showAlert('Error',errorMessage) + showAlert('Sign in Error',errorMessage) // ... }); } }) firebase.auth().onAuthStateChanged(function(user) { if (user) { - window.location.replace('dashboard') + window.location.replace('../') } }); })
\ No newline at end of file |
