Skip to content

Commit

Permalink
Update auth.py
Browse files Browse the repository at this point in the history
  • Loading branch information
shawaj authored Oct 20, 2024
1 parent 7466ec4 commit db26d28
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions hw_diag/views/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,17 @@ def get_password_change_form():
@authenticate
def handle_password_change():
current_password = request.form.get('txtOriginalPassword')
new_password = request.form.get('txtNewPassword')
confirm_password = request.form.get('txtConfirmPassword')
PASSWORD_OVERRIDE = os.getenv('PASSWORD_OVERRIDE', 'false')

if PASSWORD_OVERRIDE != "false": # nosec
new_password = PASSWORD_OVERRIDE
confirm_password = new_password
logging.info("Password overriden env var - not updating!")
else:
new_password = request.form.get('txtNewPassword')
confirm_password = request.form.get('txtConfirmPassword')
logging.info("No password override. Saving new password!")

result = update_password(
current_password,
new_password,
Expand Down

0 comments on commit db26d28

Please sign in to comment.