MongoDB node.js code not sending to mongoDB database

This code is supposed to get login info, and send it to a MongoDB database. But when i submit it, for some reason it goes on loading forever, and when I refresh, it says that i cannot override details (details is the details im sending.) Why is that happening? I know the credentials in this repo isnt correct bcz i dont want to reveal mine (in routes/database.js for the mongo code), so replace it with yours when testing.