Added more unit tests for user authentication logic