fix: remove refresh token on access denied #1776
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When logging in the bot removes error listeners and only adds them back when successfully logged in. This means that if you first start the bot and get the accessdenied error, then the bot will keep crashing because it keeps trying to sign in using the invalid refresh token.
Bot registers handler for error events on the client:
tf2autobot/src/classes/Bot.ts
Line 846 in 133b3da
tf2autobot/src/classes/Bot.ts
Lines 1616 to 1644 in 133b3da
Bot removes error listeners when attempting to log in:
tf2autobot/src/classes/Bot.ts
Lines 1389 to 1397 in 133b3da
Bot does not handle access denied errors in the login error handler:
tf2autobot/src/classes/Bot.ts
Lines 1408 to 1417 in 133b3da