make login work and use MongoDB