diff options
| -rw-r--r-- | index.html | 6 | ||||
| -rw-r--r-- | login/index.html | 1 | ||||
| -rw-r--r-- | shared/js/Login.js | 9 |
3 files changed, 10 insertions, 6 deletions
@@ -83,11 +83,11 @@ </div> </div> </div> - <script src="shared/jquery.js"></script> + <script src="shared/js/jquery.js"></script> <script crossorigin="anonymous" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script> <script crossorigin="anonymous" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script> <script src="https://www.gstatic.com/firebasejs/6.1.0/firebase.js"></script> - <script src="shared/firebaseConfig.js"></script> - <script src="shared/LoginCheck.js"></script> + <script src="shared/js/firebaseConfig.js"></script> + <script src="shared/js/LoginCheck.js"></script> </body> </html> diff --git a/login/index.html b/login/index.html index 4556d30..f051603 100644 --- a/login/index.html +++ b/login/index.html @@ -69,6 +69,7 @@ <input class="form-control" id="password" placeholder="Password" type="password"> </div> <button class="btn btn-primary" id="login">Login</button> + <a href="#" class="btn btn-link">Not a user? Signup.</a> </div> </div> </div> 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 |
