MongoDB implementation of auth with tests