Closed simonhowey closed 7 years ago
@Simonah88 thanks for the PR. Can you remind me the situation that leads to this code being needed again?
I had logged in early in the semester and never logged out, I think at some point my token became invalid. When visiting the class portal the default view is the student portal and it only reroutes you if you don't have any token but doesn't check against a bad token.
You can reproduce with: localStorage.token = "s"
in the console and refresh.
You get:
It isn't very clear that this is the result of an authentication error
Gotcha. One question, just tapping logout and login seems to fix this right now, does this patch do the same thing, or does it just force the logout?
Yes tapping log in and log out does fix it. Client side the code is identical to your logout buttons success/failure callbacks but it doesn't do the AJAX logout request.
Are you hinting that I should have just used the logout code that is already there? :)
No, I was just wondering if it should automatically do the login at the same time if it encounters this not-unusual condition. But at least this will keep things from looking inconsistent. Thanks again for the PR.
figured you wouldn't want everyone logged out if the api went down