 <p>Please edit the code, it looks like you have an error on mongo with 'Admin.findOne'</p> <pre><code>if(err) deferred.resolve(err); </code></pre> <p>to </p> <pre><code>if(err) deferred.reject(err); </code></pre>