Added Login Validation

Reject login attempts with invalid input.
Display error if a connection attempt fails. (Displays a message which
reveals possible reasons for the failure).