Fixed the bug in MongoDB authentication