This PR adds error handling to the authenticate() function. The callback that is passed to the API receives an optional error as the first argument. The second argument is the cookie that was received. The lib code base and the examples have been adjusted.
The change is still backward-compatible. If a callback is passed that only takes one parameter (i.e. the cookie), then the callback will be called with the cookie and no error.
This PR adds error handling to the
authenticate()
function. The callback that is passed to the API receives an optional error as the first argument. The second argument is the cookie that was received. The lib code base and the examples have been adjusted.The change is still backward-compatible. If a callback is passed that only takes one parameter (i.e. the cookie), then the callback will be called with the cookie and no error.
Max