Make authentication work with mongoose