microblog.pub/templates/login.html

47 lines
991 B
HTML
Raw Normal View History

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 %}
2019-09-08 08:06:52 -05:00
{% block header %}
2018-07-15 14:25:09 -05:00
<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">
<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="">
{% else %}
{% endif %}
2019-04-08 10:54:51 -05:00
<input type="submit" value="login">
2018-05-18 13:41:41 -05:00
</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 %}