Mercurial > bugzilla-dashboard
diff js/modules/app.js @ 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 | 4728c2db6fd6 |
children | 440c8e2d776d |
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) {