Added tests for user authentication. Fixed validation errors.