title: User Auth With AngularJs
body: <p>I just started angularfire Auth! And i get this problem when i sign in, And if you guys have any advice on how to make a email registration form i would be more than glad to hear that . Here is the error i receive :</p>
  
  <blockquote>
    <p>Error: Firebase.authWithPassword failed: First argument must be a valid object.</p>
  </blockquote>
  
  <p>Here is my 
  <strong>script.js:</strong></p>
  
  <pre><code>var app = angular.module('LoginApp', ["firebase"])
  app.controller('AuthCtrl', [
    '$scope', '$rootScope', '$firebaseAuth', function($scope, $rootScope, $firebaseAuth) {
  
    var ref = new Firebase('https://uniquecoders.firebaseio.com/')
    $scope.auth = $firebaseAuth(ref);
  
    $scope.signIn = function(){
      var ref = new Firebase('https://uniquecoders.firebaseio.com/')
      ref.authWithPassword('email', {
          email: $scope.signInEmail,
          password: $scope.signInPassword
      }, function(error,userData){
          if(error = 'INVALID_EMAIL'){
              alert("The Email you entered is Invalid")
          }
          else if(error = 'INVALID_PASSWORD'){
              alert("The Password you entered is Invalid")
          }
          else{
              console.log(error)
          }
      })
  
    }
    }]
    );
  </code></pre>
  
  <p>and our <strong>Index.html</strong>:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en-US"&gt;
  &lt;head&gt;
          &lt;script src="jquery.js"&gt;&lt;/script&gt;
      &lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.js"&gt;&lt;/script&gt;
      &lt;script src="https://cdn.firebase.com/js/client/2.2.4/firebase.js"&gt;&lt;/script&gt;
      &lt;script src="https://cdn.firebase.com/libs/angularfire/1.1.3/angularfire.min.js"&gt;&lt;/script&gt;
      &lt;script src="https://cdn.firebase.com/js/simple-login/1.6.2/firebase-simple-login.js"&gt;&lt;/script&gt;
      &lt;script src = "http://s.codepen.io/assets/libs/modernizr.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="script.js"&gt;&lt;/script&gt;
  
      &lt;meta charset="UTF-8"&gt;
      &lt;meta name="X-UA-Compatible" content=""&gt;
      &lt;meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no"&gt;
      &lt;meta name="keywords" content=""&gt;
      &lt;meta name="description" content=""&gt;
      &lt;title&gt;Login - UniqueCoders&lt;/title&gt;
      &lt;link rel="icon" href="favicon.ico"&gt;
      &lt;link rel="stylesheet" href="main.css"&gt;
  &lt;/head&gt;
  &lt;body ng-app="LoginApp"&gt;
      &lt;div id="page"&gt;
          &lt;header class="container"&gt;
              &lt;div class="row"&gt;
                  &lt;img src="https://lh5.googleusercontent.com/-UXr_le-DEc4/VogTLE2yDfI/AAAAAAAAAfI/9RycRDVGNu8/w993-h207-no/uniquecoders.png" alt="UniqueCoders"&gt;
              &lt;/div&gt;
          &lt;/header&gt;
          &lt;main class="container"&gt;
              &lt;div class="row login"&gt;
                  &lt;form ng-controller="AuthCtrl"&gt;
                      &lt;input type="email" name="email" placeholder="Email" ng-model = "signInemail" id="email"&gt;
                      &lt;input type="password" name="password" ng-model = "signInpassword" placeholder="Password" id="password"&gt;
                      &lt;input type="submit" value="Login" ng-click = "signIn()"&gt;
                  &lt;/form&gt;
              &lt;/div&gt;
          &lt;/main&gt;
          &lt;footer class="container"&gt;
              &lt;div class="row"&gt;
                  &lt;small&gt;&amp;copy; 2016. Unique Coders&lt;/small&gt;
              &lt;/div&gt;
          &lt;/footer&gt;
      &lt;/div&gt;
      &lt;!-- Scripts at the end for faster loading --&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>