"Matthew Carter" wrote:
> I have fixed the function call, it seems setInterval and setTimeout both have trouble > accepting parameters. You can get around this by using "Function.prototype.bind()". eg the > last line of the pastebin is now:
> setInterval(retrieveNewAttempts.bind(null, token), 5000)
> However, I am still interested in what kind error handling needs to be done for ajax, and how > to do it? Happy to be pointed in the right direction and not spoon-fed as I'm sure there is a > bit to it.
> In addition, I do not know when/how I should revoke a token from a user?
> Sincerely,> Matthew Carter
This was covered in yesterdays lecture. For a REST API you should revoke a token when a user
requests it (a DELETE request is sent to /api/token/) or the token expires (so a token expiry
date is stred with the token).