5apps / stashboard

A remoteStorage account dashboard
https://5apps.com/storage
MIT License
6 stars 2 forks source link

Fix endless redirects #13

Closed galfert closed 4 years ago

galfert commented 6 years ago

Closes #11

TODO

raucao commented 5 years ago

Shouldn't a 401 and session invalidation just redirect back to the login screen?

raucao commented 4 years ago

thumbs-up-daft-punk

galfert commented 4 years ago

I think this is ready to merge now. When the request for the user data fails with a 401, i.e. the user is not authenticated (anymore), the session will be invalided and the user will be redirected to the login screen.

For all other loading errors, an error message is shown to the user. When the user confirms the dialog, the loading will be retried. As the most likely scenario for this is some server error during development, I chose as simple alert dialog for showing the error message.

For testing this, I just put a http_status 500 and return in the platform's profile method in app/controllers/api/user_controller.rb.