changeset 58:f9001601bed6

authenticated users now get an authenticated dashboard w/ confidential bugs.
author Atul Varma <avarma@mozilla.com>
date Sun, 25 Apr 2010 00:51:07 -0700
parents 2bd4a44f1182
children 440c8e2d776d
files js/modules/app.js
diffstat 1 files changed, 19 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/js/modules/app.js	Sun Apr 25 00:19:18 2010 -0700
+++ b/js/modules/app.js	Sun Apr 25 00:51:07 2010 -0700
@@ -32,6 +32,24 @@
   };
 };
 
+Require.modules["app/bugzilla-auth"] = function(exports, require) {
+  exports.Bugzilla = {
+    ajax: function ajax(options) {
+      var user = require("app/login").get();
+
+      if (user.isAuthenticated) {
+        if (!options.data)
+          options.data = {};
+        options.data.username = user.username;
+        options.data.password = user.password;
+      }
+
+      return this.__proto__.ajax.call(this, options);
+    },
+    __proto__: require("bugzilla")
+  };
+};
+
 Require.modules["app/ui/login-form"] = function(exports, require) {
   var $ = require("jQuery");
 
@@ -196,7 +214,7 @@
   var $ = require("jQuery");
   var cache = require("cache");
   var dateUtils = require("date-utils");
-  var bugzilla = require("bugzilla");
+  var bugzilla = require("app/bugzilla-auth").Bugzilla;
   var window = require("window");
 
   function sortByLastChanged(bugs) {