Require explicitly allowing old passwords

+ close connection if authentication fails
Small refactoring