Skip to content

Delete saved creds on auth failure and rename creds var#68

Open
jfrederickson wants to merge 1 commit into
masterfrom
fix/creds-handle-failure
Open

Delete saved creds on auth failure and rename creds var#68
jfrederickson wants to merge 1 commit into
masterfrom
fix/creds-handle-failure

Conversation

@jfrederickson

Copy link
Copy Markdown
Collaborator

In the event an access token is revoked, we might still have user/pass
credentials that are valid. If we receive a 401 or 403, we can be
reasonably sure that the credentials in the bot's state are invalid,
so let's just clear them out.

Sibyl will still disable the Matrix protocol if this happens,
requiring a restart; this just ensures that you won't have to dig
around in/delete the pickled state to get back up and running.

In the event an access token is revoked, we might still have user/pass
credentials that are valid. If we receive a 401 or 403, we can be
reasonably sure that the credentials in the bot's state are invalid,
so let's just clear them out.

Sibyl will still disable the Matrix protocol if this happens,
requiring a restart; this just ensures that you won't have to dig
around in/delete the pickled state to get back up and running.

@jahschwa jahschwa left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thought about this a bit, is there a case we wouldn't want to immediately try again with username/password if the token fails? "If we have a token, try to connect with the token, catch MatrixRequestError[401, 403] and set token to None, try to connect with password" and "We don't have a token, try to connect with password"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants