aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKumar Priyansh <[email protected]>2019-06-09 19:44:47 +0530
committerKumar Priyansh <[email protected]>2019-06-09 19:44:47 +0530
commitc6e8231b317c3104f49222b1628f2d7287de13a8 (patch)
tree85cfa0c8904f115a1a8adfd1df60c6c96801111e
parentd19e879609da765d2a9d74990e25ad1761216654 (diff)
downloadfirebase-ecommerce-c6e8231b317c3104f49222b1628f2d7287de13a8.tar.xz
firebase-ecommerce-c6e8231b317c3104f49222b1628f2d7287de13a8.zip
Login Functions Updated
-rw-r--r--index.html6
-rw-r--r--login/index.html1
-rw-r--r--shared/js/Login.js9
3 files changed, 10 insertions, 6 deletions
diff --git a/index.html b/index.html
index 9dd56b9..d4b55d3 100644
--- a/index.html
+++ b/index.html
@@ -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('&emsp;<div class="spinner-grow spinner-grow-sm text-light" role="status"><span class="sr-only">Loading...</span></div>&emsp;');
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