summaryrefslogtreecommitdiff
path: root/res/templates/login.html
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2015-01-12 12:52:40 +0200
committerAlon Levy <alon@pobox.com>2015-01-12 12:55:11 +0200
commit5e80077fae6495901e9c7576995ded06a1dde5c8 (patch)
tree6717e10f5f3e59179e0c6ec5abbb5c1feb2a7630 /res/templates/login.html
parent944618160f5c974bbe463f1a7e0572ea76a476e4 (diff)
client/server: login is using POST, so use POST, not XMLHttpRequest
TODO: Logout requires styling plus only to appear if logged in.
Diffstat (limited to 'res/templates/login.html')
-rw-r--r--res/templates/login.html27
1 files changed, 3 insertions, 24 deletions
diff --git a/res/templates/login.html b/res/templates/login.html
index f35bccdc..3e32eee3 100644
--- a/res/templates/login.html
+++ b/res/templates/login.html
@@ -4,28 +4,7 @@
<title>Welcome to Rhizi</title>
<link href="/static/css/style.css" rel="stylesheet" type="text/css">
<script src="/static/lib/jquery.js" type="text/javascript"></script>
-<script type="text/javascript">
- function submit_login_form() {
- var data = {
- username : $('#login_username').val(),
- password : $('#login_password').val()
- };
-
- // TODO: validate
-
- $.ajax({
- type : "POST",
- url: '/login',
- async : false,
- cache : false,
- data : JSON.stringify(data),
- dataType : 'json',
- contentType : "application/json; charset=utf-8"
- });
- }
-</script>
</head>
-
<body class="login-background">
<div class="welcome-box">
<img src="/static/img/logo-red.png" class="login-rhizi-logo">
@@ -39,9 +18,9 @@
</div>
<div id="login_form_panel" class="login-form">
<fieldset>
- <form action="javascript:void(0);" method="get" onsubmit="submit_login_form();" id="login_form">
- <input class="login-input" type="email" id="login_username" placeholder="Email">
- <input class="login-input" type="password" id="login_password" placeholder="Password" required value="Password">
+ <form action="/login" method="POST" id="login_form">
+ <input class="login-input" type="email" name="username" id="login-username" placeholder="Email">
+ <input class="login-input" type="password" name="password" id="login-password" placeholder="Password" required value="Password">
<input class="login-input" type="submit" value="Sign in">
<a class="forgot-password"> forgot password? </a>
</form>