Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
44 lines (41 sloc) 1.19 KB
<!DOCTYPE html>
<html>
<head>
<title>Deployd login form</title>
<link rel="stylesheet" type="text/css" href="/css/bootstrap.min.css" />
</head>
<body>
<div class="container">
<h1>Login</h1>
<form>
<label for="username">Username:</label>
<input type="text" id="username" />
<label for="password">Password:</label>
<input type="password" id="password" /><br />
<button type="submit" class="btn btn-primary">Login</button>
<a href="/register.html" class="btn btn-link">sign up</a>
</form>
</div>
<script type="text/javascript" src="/js/lib/jquery.js"></script>
<script type="text/javascript" src="/dpd.js"></script>
<script type="text/javascript">
dpd.users.me(function(user) {
if (user) {
location.href = "/welcome.html";
}
});
$('form').submit(function() {
var username = $('#username').val();
var password = $('#password').val();
dpd.users.login({username: username, password: password}, function(session, error) {
if (error) {
alert(error.message);
} else {
location.href = "/welcome.html";
}
});
return false;
});
</script>
</body>
</html>