Dear all,
I got the authenticator already working (he POSTS the credentials to the server, gets a token and stores the token in the session) but I have no luck at all to understand the authorizer. I want to make the authorizer to add a “Authorization: Token ” header to all of my network requests an have therefore to implement authorize(sessionData, block) {) method in the authorizer. If I log the sessionData and block, I get the following output:
sessionData: {"authenticator":"authenticator:custom","token":"520ccbfe7caedac37588bdbde93d5d3514bf7f3b","success":true,"error":null}
block : function (headerName, headerValue) {
xhr.setRequestHeader(headerName, headerValue);
}
So, extracting the actual token value shouldn’t be hard, but how to deal with the closure?
Sorry for being stupid, Martin
P.S. The funny thing is that my code already works because all subsequent network request are authorized by by the authenticator’s magic which stored the session and token in browser’s local storage…