Commit d29efb23 authored by Nicolas Wavrant's avatar Nicolas Wavrant

javascript now handle connexion and account creation using

basic auth
parent 05913751
......@@ -43,6 +43,8 @@ $(document).ready(function () {
return false;
}
send = true;
var base_url = 'https://' + $("input#username").val() + ':'
+ $("input#password").val() + '@' + location.host
$.ajax({
type: "POST",
url: $SCRIPT_ROOT + ((hasAccount) ? '/updateAccount' : '/configAccount'),
......@@ -55,7 +57,7 @@ $(document).ready(function () {
},
success: function (data) {
if (data.code === 1) {
window.location.href = $SCRIPT_ROOT + "/";
window.location.href = base_url + $SCRIPT_ROOT + '/';
} else {
$("#error").Popup(data.result, {type: 'error', duration: 5000});
}
......
......@@ -27,7 +27,9 @@ $(document).ready(function () {
$("#login").removeClass("button").addClass("dsblebutton");
$.post(url, param, function (data) {
if (data.code === 1) {
window.location.href = $SCRIPT_ROOT + '/';
url = 'https://' + param.clogin + ':' + param.cpwd + '@'
+ location.host + $SCRIPT_ROOT + '/';
window.location.href = url;
} else {
$("#error").Popup(data.result, {type: 'alert', duration: 3000});
}
......
......@@ -18,6 +18,5 @@
<input type="reset" class="button" value="reset" />
<input type="submit" class="button" id="login" value="login" />
</div>
<p><a href="https://nwavrant:nicolas@[2001:67c:1254:3b:fc93:4aff:feca:66ac]:50005/">Next</a></p>
</form>
{% endblock %}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment