-
Notifications
You must be signed in to change notification settings - Fork 687
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not lose authentication token when the connection gets lost #369
Conversation
login.find(".btn").prop("disabled", false); | ||
var token = window.localStorage.getItem("token"); | ||
if (token) { | ||
window.localStorage.removeItem("token"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the actual offender. I chose to never delete the token even on failed auths to show the "authorisation failed" message to the user until they relogin.
Looks all good to me! 👍 |
Testing this, I hit a weird bug. To reproduce:
I am going to review #370 instead of looking further into this. I don't think it's worth fixing this in an isolated way considering it has to do with restarting the server. |
@astorije That was actually intentional, I mentioned it in IRC. However considering it keeps doing that after entering a wrong password, I should remove the token when that happens. EDIT: It will remove stored token on a failed authentication. |
e78c4cc
to
2008abc
Compare
So, I definitely hit the bug many times on mobile, but I cannot consistently reproduce it on laptop right now. That being said, code looks fine, @maxpoulin64 said he tested a bit more than just reading the code, and I tested that previous behavior didn't happen (i.e. that we have iso-functionality with what we had before PR) so I'm 👍. |
Do not lose authentication token when the connection gets lost
No description provided.