Weird app crash when adding user to the room - ERR_TOO_MANY_REDIRECTS after GitHub 403 forbidden
We have room https://gitter.im/mobxjs/team. I have added several people in there before. Now when I try to invite another person @mayorovp through "Add people to this room" dialog, it briefly shows red label "Error" after confirming him and the app starts behaving completely unresponsive. When I try to reload, I am getting error from Chrome as on the picture.
I tried accessing different rooms directly through URL, but the same result. Visiting gitter.im through anonymous mode works.
It already happened to me once yesterday. Today I was able to access the app again, but after doing the same action I get the same result.
I am not sure if that person actually has Gitter account, but he is on GitHub for sure. If that's a problem, it should be probably handled more gracefully :)
Reproduction
- Have a Gitter tab open
- Somewhere in the server (like
server/handlers/home.js#L23
, add the following
var logoutDestroyTokens = require('../web/middlewares/logout-destroy-tokens');
return logoutDestroyTokens(req, res, next);
- Trigger that request in another tab
- Refresh your main Gitter tab
- To get out of the loop, clear your cookies
Here is the log of what happens once you are in the loop,
2020-01-06T22:41:44.765Z - warn: Invalid token presented:
{ token: '85d72ccd4f63a2bf05b6f293b1af6e177cc7e777' }
2020-01-06T22:41:44.773Z - warn: tokenless-user-middleware: authenticated user has no tokens, rejecting.
{ username: 'EricTroupeTester',
userId: '5a9582461543b98772a686b3' }
2020-01-06T22:41:44.780Z - warn: logout-destroy-tokens: performing logout
{ userId: '5a9582461543b98772a686b3',
username: 'EricTroupeTester' }
2020-01-06T22:41:44.783Z - info: logout: logging out user
{ userId: '5a9582461543b98772a686b3',
username: 'EricTroupeTester' }
2020-01-06T22:41:44.792Z - warn: Unable to log user out
2020-01-06T22:41:44.826Z - warn: Invalid token presented:
{ token: '3537d2ea8155ab9724efa71958bb904d6785816b' }
2020-01-06T22:41:44.834Z - warn: tokenless-user-middleware: authenticated user has no tokens, rejecting.
{ username: 'EricTroupeTester',
userId: '5a9582461543b98772a686b3' }
2020-01-06T22:41:44.839Z - warn: logout-destroy-tokens: performing logout
{ userId: '5a9582461543b98772a686b3',
username: 'EricTroupeTester' }
2020-01-06T22:41:44.843Z - info: logout: logging out user
{ userId: '5a9582461543b98772a686b3',
username: 'EricTroupeTester' }
2020-01-06T22:41:44.848Z - warn: Unable to log user out
...