Check password when login.

Fetch the password of the given user from mongodb and check if the password is
correct.