added add_key()

This commit is contained in:
iou1name 2019-06-23 15:03:03 -04:00
parent b15e0be464
commit 50d8e1863e
3 changed files with 30 additions and 0 deletions

11
auth.py
View File

@ -303,3 +303,14 @@ def delete_token():
return jsonify(ok=True)
else:
return make_error(404, "token not found")
@auth_views.route('/add_key')
@auth_required
def add_key():
"""
Allows a user to add a new security key to their account.
"""
params = {
'url_prefix': config.url_prefix,
}
return render_template('register_key.html', **params)

View File

@ -112,3 +112,16 @@ nav span:hover {
.sub-table {
margin-top: 5em;
}
.manage-table tfoot td {
border: none;
}
.add {
color: dimgrey;
}
.add:hover {
color: red;
cursor: pointer;
}

View File

@ -26,6 +26,12 @@
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr>
<td><span title="Add a new security key" class="add font-awesome" onclick="window.location=url_prefix+'/add_key'">&#xe802;</span></td>
<td>New key</td>
</tr>
</tfoot>
</table>
<h2 class="sub-table">Tokens</h2>
<table id="tokens" class="manage-table">