jumpserver/apps/users/templates/users/user_password_verify.html

38 lines
1.2 KiB
Python

{% extends '_base_only_content.html' %}
{% load static %}
{% load i18n %}
{% load bootstrap3 %}
{% block custom_head_css_js %}
{% endblock %}
{% block html_title %}{% trans 'Verify password' %}{% endblock %}
{% block title %} {% trans 'Verify password' %}{% endblock %}
{% block content %}
<form class="" role="form" method="post" action="" class="form-horizontal">
{% if 'password' in form.errors %}
<p class="red-fonts">{{ form.password.errors.as_text }}</p>
{% endif %}
{% csrf_token %}
<div class="form-input form-group">
<input type="password" id="password" class="form-control" name="{{ form.password.html_name }}" placeholder="{% trans 'Password' %}" required="">
</div>
<button type="submit" class="btn btn-primary">{% trans 'Confirm' %}</button>
</form>
<script>
$("form").submit(function(){
// Let's find the input to check
var passwordRef = $('#password')
var value = passwordRef.val()
if (value) {
// Value is falsey (i.e. null), lets set a new one
value = encryptPassword(value)
passwordRef.val(value)
}
});
</script>
{% endblock %}