Skip to content

Instantly share code, notes, and snippets.

@matzew
Created October 1, 2012 16:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matzew/3812824 to your computer and use it in GitHub Desktop.
Save matzew/3812824 to your computer and use it in GitHub Desktop.
// WRONG authenticator (or even nil)
var somePipeline = aerogear.pipeline([ { name: "tasks", settings: { baseURL: "somePROTECTED_URL", authenticator: null}}]);
var myPipe = somePipeline.pipes["tasks"];
myPipe.read(); // returns 401 status-code when going against a SERVER that requires auth
However, 'myPipe.isAuthenticated()' returns TRUE as the default... - which is wrong when no (or 'wrong') authenticator has been attached.
// ==== SRC of isAuthenticated ====
isAuthenticated: function() {
return this.authenticator ? this.authenticator.isAuthenticated() : true;
},
// ===== END ==================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment