ucam-cl-dtg / urop-2014-ticking-ui

The project responsible for viewing, managing and interacting with ticks, ticking work etc.
Apache License 2.0
0 stars 0 forks source link

Pressing logout and then the back button results in loading bar that does not go away #41

Open drt24 opened 10 years ago

drt24 commented 10 years ago

If you press logout and then the back button then you get a loading bar which does not go away, refreshing the page gets you to login again.

TomLefley commented 10 years ago

So we've tried fixing this previously. Raven protects all of our endpoints and sends back 302s to the login page when someone without a session tries to get at them, which happens after a logout as your session is invalidated. However, as all of our calls to the endpoints are AJAX, the 302 redirect is also AJAX and a page redirect does not happen. So, while the website is inoperative after a logout, you can still see the scaffold yes until you refresh. The only way I can think to fix this would be to disable caching for the website, which I'm not keen on doing.

drt24 commented 10 years ago

The AJAX request should fail which means that the onerror callback should be called which can see the 401 error code and cause the page to be refreshed.

TomLefley commented 10 years ago

Unfortunately this is not the case. They all come back as 302s to the raven login page, but because the standard requires that 302 be seamless I cannot intercept it.