Open douglasnaphas opened 3 years ago
I sent an email to doug@passover.lol about failed joins that has some thoughts about this.
I'm going to try cutting a feature branch with the refresh token length shortened.
I noted a few user sub claims in CloudWatch that are suspected instances of this bug happening. They have log entries like pullTokensFromCookies: user with no access_token: <sub>
. Sometimes sub
is in the user pool, sometimes it isn't. My theory is that the bug happened when either of these happened:
sub
. These would be the instances where I can't currently find the sub from the logs in the user pool. I deleted the user pools various times, or swapped out the user pool for one from a totally different stack, especially with respect to people like AB who probably hadn't logged in since the previous year. I could look for those users in the real legacy user pool.Update: of the four that I saw throwing the error in the logs, three are explained by category (1) above (the client sent the user pool sub from the 2020 user pool when trying to join a 2021 seder).
What do I do when the user
that comes with a request is a sub that matches multiple user pool entries?
If I manually delete my refresh token, but not my access token, while logged in, /join-seder comes back with 500. If I then delete my access token, so that I have neither access nor refresh, then I get 401 from /join-seder.
I think that part of what has to happen when a person tries to join a seder without the proper JWTs is that the frontend should do a fetch to a backend endpoint that will destroy their JWTs. That endpoint is part of #253, so I am prioritizing that before going forward with this Issue.
I believe that this was users (SS, SD, AB) who had logged in an hour or more earlier, maybe even the prior year, and that I wasn't handling the refresh token properly.
Steps to reproduce:
Expected behavior: you can join fine.
Bug: your Join button is disabled. No error message, no "sorry, you couldn't join."
Check logs for things I think with messages like "no access token" from during the first night of Passover 2021.