Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not retry login after logging out #320

Closed
jan-law opened this issue Oct 8, 2021 · 0 comments · Fixed by #321
Closed

Do not retry login after logging out #320

jan-law opened this issue Oct 8, 2021 · 0 comments · Fixed by #321
Assignees
Labels
bug Something isn't working

Comments

@jan-law
Copy link
Contributor

jan-law commented Oct 8, 2021

The following condition shouldRetryLogin should only evaluate to true when the web-client has valid credentials and was temporarily disconnected from the backend. However, the code below evaluates to true before the user is logged in, where ready.code is undefined and ready.ready is false. hasInvalidCredentials then evaluates to false regardless of whether the CloseStatus indicated a protocol failure. shouldRetryLogin then becomes true, triggering repeated auth calls.

Login.tsx:

const hasInvalidCredentials = !!ready.code && ready.code === CloseStatus.PROTOCOL_FAILURE;
const shouldRetryLogin = (!hasInvalidCredentials && !ready.ready)
|| (!!token && ready.ready);
@jan-law jan-law added the bug Something isn't working label Oct 8, 2021
@jan-law jan-law self-assigned this Oct 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant