mirror of
https://github.com/dgtlmoon/changedetection.io.git
synced 2025-12-19 06:25:45 +00:00
Be sure not to use blank passwords as the password
This commit is contained in:
@@ -483,6 +483,9 @@ def changedetection_app(config=None, datastore_o=None):
|
||||
flash("Password protection enabled.", 'notice')
|
||||
flask_login.logout_user()
|
||||
return redirect(url_for('index'))
|
||||
else:
|
||||
# Unset it anyway, just to be sure.
|
||||
datastore.data['settings']['application']['password'] = False
|
||||
|
||||
flash("Settings updated.")
|
||||
|
||||
|
||||
@@ -46,11 +46,12 @@ class SaltyPasswordField(StringField):
|
||||
# incoming
|
||||
def process_formdata(self, valuelist):
|
||||
if valuelist:
|
||||
# Remove empty strings
|
||||
# Be really sure it's non-zero in length
|
||||
if len(valuelist[0].strip()) > 0:
|
||||
self.encrypted_password = self.build_password(valuelist[0])
|
||||
self.data = []
|
||||
self.data = ""
|
||||
else:
|
||||
self.data = []
|
||||
self.data = False
|
||||
|
||||
|
||||
# Separated by key:value
|
||||
|
||||
Reference in New Issue
Block a user