Detect invalid login and emit event for it. For #20.