# HG changeset patch # User Atul Varma # Date 1272181867 25200 # Node ID f9001601bed63684f3bcfbff6693ff90fb862de6 # Parent 2bd4a44f1182360f42bb7e835c76ba237d1948e8 authenticated users now get an authenticated dashboard w/ confidential bugs. diff -r 2bd4a44f1182 -r f9001601bed6 js/modules/app.js --- 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) {