Zenika / Zenika-Resume

Markdown editor for resumes.
https://resume.zenika.com
MIT License
4 stars 4 forks source link

:bug: fix auth loop when invalid token present in local storage #47

Closed hgwood closed 5 years ago

hgwood commented 5 years ago

What actually fixed the bug is using logout instead of login upon receiving a 401, because the former cleans up local values before trying to login again, which prevents the usage of local values when re-entering the application. I think it makes sense to clean up after a 401 because clearly that means that local values are no longer useful.

The if (this.isAuthenticated()) is still useful is some cases but it cannot catch everything since the server and the client might not agree on what time it is.

hgwood commented 5 years ago

I'll merge because it's a blocking bug for most people but feel free to comment anyway.