diff --git a/luser/routes.py b/luser/routes.py index a975f73..c456aca 100644 --- a/luser/routes.py +++ b/luser/routes.py @@ -91,6 +91,7 @@ def register(): elif request.method == 'POST': username = request.form['username'] password = request.form['password'] + confirmpassword = request.form['confirmpassword'] captcha_answer = request.form['captchaa'] captcha_filename = request.form['captchaq'] captcha_path = CAPTCHA_PATH + captcha_filename @@ -117,6 +118,10 @@ def register(): if len(password) < 8: return 'Error: password is too short' + # Check lenght of password + if password != confirmpassword: + return 'Error: passwords do not match' + # Check if username has uppercase if username.islower() == False: return 'Error: uppercase characters in username are not allowed' diff --git a/luser/templates/register.html b/luser/templates/register.html index 87267b8..57e9b8c 100644 --- a/luser/templates/register.html +++ b/luser/templates/register.html @@ -17,6 +17,8 @@ + +
password must be at least 8 characters long