Skip to content

Instantly share code, notes, and snippets.

@matzew
Created Oct 1, 2012
Embed
What would you like to do?
// 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