Include username and password length requirements on form.
This commit is contained in:
parent
31b808bd64
commit
df211454bb
2 changed files with 9 additions and 3 deletions
|
@ -45,7 +45,13 @@ def get_user_id_redirect(user_id):
|
|||
@session_manager.give_token
|
||||
def get_login():
|
||||
session = session_manager.get(request)
|
||||
return flask.render_template('login.html', session=session)
|
||||
response = flask.render_template(
|
||||
'login.html',
|
||||
session=session,
|
||||
min_username_length=common.P.config['user']['min_length'],
|
||||
min_password_length=common.P.config['user']['min_password_length'],
|
||||
)
|
||||
return response
|
||||
|
||||
@site.route('/login', methods=['POST'])
|
||||
@session_manager.give_token
|
||||
|
|
|
@ -85,8 +85,8 @@ button
|
|||
</div>
|
||||
<div id="register_form" action="/register" method="post">
|
||||
<span>Register</span>
|
||||
<input type="text" id="register_input_username" name="username" placeholder="username">
|
||||
<input type="password" id="register_input_password_1" name="password_1" placeholder="password">
|
||||
<input type="text" id="register_input_username" name="username" placeholder="username (at least {{min_username_length}})">
|
||||
<input type="password" id="register_input_password_1" name="password_1" placeholder="password (at least {{min_password_length}})">
|
||||
<input type="password" id="register_input_password_2" name="password_2" placeholder="password again">
|
||||
<button type="submit" id="register_input_button" onclick="submit_register()">Register</button>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue