Adding a check for zero length password in authenticate and a test case