2018-05-18 13:41:41 -05:00
|
|
|
{% extends "layout.html" %}
|
|
|
|
{% import 'utils.html' as utils %}
|
2018-05-21 14:03:21 -05:00
|
|
|
{% block title %}Login - {{ config.NAME }}{% endblock %}
|
2018-07-15 14:25:09 -05:00
|
|
|
{% block headers %}
|
|
|
|
<style>
|
|
|
|
#login-container {
|
|
|
|
height: 90%;
|
|
|
|
display: grid;
|
|
|
|
}
|
|
|
|
#login-form {
|
|
|
|
margin:auto;
|
|
|
|
display:inline;
|
|
|
|
}
|
|
|
|
</style>
|
2018-05-18 13:41:41 -05:00
|
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
2018-07-15 14:25:09 -05:00
|
|
|
<div id="login-container">
|
2018-05-18 13:41:41 -05:00
|
|
|
|
|
|
|
<form id="login-form" method="POST">
|
2018-06-01 14:54:43 -05:00
|
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
|
2018-05-18 13:41:41 -05:00
|
|
|
<input type="password" name="pass" placeholder="password">
|
|
|
|
{% if u2f_enabled %}
|
|
|
|
<input type="hidden" name="resp" id="sig-payload" value="">
|
|
|
|
<input type="submit" value="waiting for u2f" disabled>
|
|
|
|
{% else %}
|
|
|
|
<input type="submit" value="login">
|
|
|
|
{% endif %}
|
|
|
|
</form>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
{% if u2f_enabled %}
|
|
|
|
<script>
|
|
|
|
var p = {{ payload | tojson }};
|
|
|
|
if (p) {
|
|
|
|
u2f.sign(p.appId, p.challenge, p.registeredKeys, function(resp) {
|
|
|
|
if (resp.errorCode) {
|
|
|
|
console.log(resp)
|
|
|
|
} else {
|
|
|
|
document.getElementById('sig-payload').value = JSON.stringify(resp)
|
|
|
|
document.getElementById('login-form').submit()
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
{% endif %}
|
|
|
|
{% endblock %}
|