37 lines
922 B
HTML
37 lines
922 B
HTML
{% extends "layout.html" %}
|
|
{% import 'utils.html' as utils %}
|
|
{% block title %}Login - {{ config.NAME }}{% endblock %}
|
|
{% block header %}
|
|
{% endblock %}
|
|
{% block content %}
|
|
<div id="container">
|
|
{% if session.logged_in %}logged{% else%}not logged{%endif%}
|
|
|
|
<form id="login-form" method="POST">
|
|
<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 %}
|