-
Notifications
You must be signed in to change notification settings - Fork 0
/
login.html
74 lines (74 loc) · 2.62 KB
/
login.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/flatly.css">
<link rel="stylesheet" type="text/css" href="css/fonts/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/script.js"></script>
<script type="text/javascript" src="https://cdn.firebase.com/js/client/2.4.0/firebase.js"></script>
<title>Libra - Login</title>
</head>
<body>
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<img class="navbar-brand nav-logo" src="img/libra-white.png">
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
<li><a href="home.html">My Books</a></li>
<li><a href="search.html">Find Books</a></li>
<li><a href="#">My Account</a></li>
</ul>
</div>
</div>
</nav>
<div class="login">
<h2 class="login-header">User Login</h2>
<form action="javascript:login()">
<div class="form-group">
<br>
<input id="email" class="form-control" type="email" placeholder="Email">
<input id="pass" class="form-control" type="password" placeholder="Password" style="margin-top: 10px">
<a href="register.html" class="register">Need an account? Register here.</a>
</div>
<button class="block-button" type="submit">Login</button>
</form>
</div>
<script type="text/javascript">
function login() {
var email = $('#email').val();
var pass = $('#pass').val();
var fb = new Firebase("https://librabooks.firebaseio.com");
fb.authWithPassword({email:email,password:pass},function(error, authData) {
if (error) {
alert("Incorrect information");
} else {
var userID = authData.uid;
window.location = "home.html";
}
});
/*$.ajax({
type: "GET",
url: "http://libra-vmcool09.c9users.io/users/login",
data: {username: uname, password: pass},
success: function(data) {
console.log(data)
},
error: function(data) {
alert("Login Failed");
},
});*/
}
</script>
</body>
</html>