Faculty of Engineering and Mathematical Sciences 
Not logged in (login)

help3403


This forum is provided to promote discussion amongst students enrolled in Agile Web Development (CITS3403).
 
Options:
RSS cloud
Jump to:

Flask REST API and Live Feedback

1 of 419 articles shown, currently no other people reading this forum.
photo
From: Timothy F.
Date: Thu 21st May 2020, 11:24am
Actions: 
        Login-to-reply

 

"Matthew Carter" <22*6*8*[email protected]*u*e*t*u*a*e*u*a*> 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).

Related articles

Flask REST API and Live Feedback (all 3) RSS
├─ original   Wed 20th May 2020, 10:43am, Matthew C.
├─ reply 1   Wed 20th May 2020, 3:33pm, Matthew C.  O.P.
└─ THIS   Thu 21st May 2020, 11:24am, Timothy F.
This Page


Program written by: [email protected]
Feedback welcome
Last modified: 11:27am Sep 21 2020