$(document).ready(function(){
  $("#login-form-js").on("submit", function(){
    $this = $(this)
    $.ajax({
      url: $this.attr("action"),
      method: $this.attr("method"),
      data: $this.serialize()
    }).done(function(data){
      document.location = data.location
    }).fail(function(data){
      errorContainer = $("#login-form-errors-js");
      errorContainer.html("");
      errors = []
      if(data.responseJSON.form_errors.__all__)
        errors = errors.concat(data.responseJSON.form_errors.__all__);
      if(data.responseJSON.form_errors.email)
        errors = errors.concat(data.responseJSON.form_errors.email);
      if(data.responseJSON.form_errors.password)
        errors = errors.concat(data.responseJSON.form_errors.password);
      console.log(errors);
      for(var i=0;i<errors.length;i++){
        errorContainer.append("<p>" + errors[i] + "</p>");
      }
    })
    return false;
  });

  $("#signup-form-js").on("submit", function(){
    $this = $(this)
    $.ajax({
      url: $this.attr("action"),
      method: $this.attr("method"),
      data: $this.serialize()
    }).done(function(data){
      document.location = data.location
    }).fail(function(data){
      errorContainer = $("#signup-form-errors-js");
      errorContainer.html("");
      errors = []
      if(data.responseJSON.form_errors.__all__)
        errors = errors.concat(data.responseJSON.form_errors.__all__);
      if(data.responseJSON.form_errors.email)
        errors = errors.concat(data.responseJSON.form_errors.email);
      if(data.responseJSON.form_errors.password1)
        errors = errors.concat(data.responseJSON.form_errors.password1);
      if(data.responseJSON.form_errors.password2)
        errors = errors.concat(data.responseJSON.form_errors.password2);
      for(var i=0;i<errors.length;i++){
        errorContainer.append("<p>" + errors[i] + "</p>");
      }
    })
    return false;
  });
});

@@ -66,32 +66,36 @@
 function()%7B%0A    
+var 
 $this = $(this)%0A
@@ -86,32 +86,32 @@
 $this = $(this)%0A
-
     $.ajax(%7B%0A   
@@ -300,32 +300,36 @@
 on(data)%7B%0A      
+var 
 errorContainer =
@@ -386,32 +386,36 @@
 html(%22%22);%0A      
+var 
 errors = %5B%5D%0A    
@@ -983,16 +983,20 @@
 ()%7B%0A    
+var 
 $this = 
@@ -1213,24 +1213,28 @@
 ata)%7B%0A      
+var 
 errorContain
@@ -1294,30 +1294,34 @@
 r.html(%22%22);%0A
-
       
+var 
 errors = %5B%5D%0A

fix for global vars in auth javascript file