Created
January 17, 2013 15:42
-
-
Save lloydwatkin/4556860 to your computer and use it in GitHub Desktop.
Hack to backbone.js to get buddycloud webclient + http api server + tigase (+ buddycloud java server) talking.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -1418,9 +1419,18 @@ | |
// Make the request, allowing the user to override any Ajax options. | |
return Backbone.ajax(_.extend(params, options)); | |
}; | |
- | |
+var credentials; | |
// Set the default implementation of `Backbone.ajax` to proxy through to `$`. | |
Backbone.ajax = function() { | |
+ if (arguments[0].credentials) { | |
+ console.log("Storing credentials", arguments[0].credentials); | |
+ credentials = arguments[0].credentials; | |
+ } else if (credentials) { | |
+ arguments[0].credentials = credentials; | |
+ arguments[0].xhrFields = {withCredentials: true} | |
+ console.log("Setting credentials", arguments); | |
+ } | |
return Backbone.$.ajax.apply(Backbone.$, arguments); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sessionID stuff is a bit broken right now. There's an issue open for addressing that.