mirror of
https://github.com/janeczku/calibre-web
synced 2024-12-25 01:20:32 +00:00
Improvements for password verify (addresses: https://github.com/iiab/calibre-web/pull/138)
This commit is contained in:
parent
14b578dd3a
commit
fcc95bd895
@ -696,15 +696,15 @@ def valid_password(check_password):
|
||||
if config.config_password_min_length > 0:
|
||||
verify += r"^(?=.{" + str(config.config_password_min_length) + ",}$)"
|
||||
if config.config_password_number:
|
||||
verify += "(?=.*?\d)"
|
||||
verify += r"(?=.*?\d)"
|
||||
if config.config_password_lower:
|
||||
verify += "(?=.*?[\p{Ll}])"
|
||||
verify += r"(?=.*?[\p{Ll}])"
|
||||
if config.config_password_upper:
|
||||
verify += "(?=.*?[\p{Lu}])"
|
||||
verify += r"(?=.*?[\p{Lu}])"
|
||||
if config.config_password_character:
|
||||
verify += "(?=.*?[\p{Letter}])"
|
||||
verify += r"(?=.*?[\p{Letter}])"
|
||||
if config.config_password_special:
|
||||
verify += "(?=.*?[^\p{Letter}\s0-9])"
|
||||
verify += r"(?=.*?[^\p{Letter}\s0-9])"
|
||||
match = regex.match(verify, check_password)
|
||||
if not match:
|
||||
raise Exception(_("Password doesn't comply with password validation rules"))
|
||||
|
@ -24,7 +24,7 @@ $(document).ready(function() {
|
||||
},
|
||||
|
||||
}, function () {
|
||||
if ($('#password').data("verify")) {
|
||||
if ($('#password').data("verify") === "True") {
|
||||
// Initialized and ready to go
|
||||
var options = {};
|
||||
options.common = {
|
||||
|
Loading…
Reference in New Issue
Block a user