Handle redirection to login page if session has expired when websocket connection is attempted#2078
Open
colinl wants to merge 3 commits intoFlowFuse:mainfrom
Open
Conversation
…rection to login page
Collaborator
Author
|
This is working well for me on a PC and on Android, using Cloudflare Zero Trust and google as the authenticator. I can't test it on anything else though. I don't know what we can do to check it on other systems. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Perform an http(s) pre-fetch before websocket connection in order to detect that login is required
Description
Before an attempt is made to open the websocket connection, an attempt is made to http(s) fetch '_setup'. That is a small json file.
If there is a network error then flow drops through to the existing retry strategy.
If the fetch successfully fetches the file then it is ok to make the connection.
If the content is not of type json then the domain is accessible, but there is an issue of some sort, such as the server wants to redirect to a login page, or has served the login page directly. In that case the code forces a page reload, which will take the user to the login page.
Related Issue(s)
Closes #2074
Checklist
flowforge.yml?FlowFuse/helmto update ConfigMap TemplateFlowFuse/CloudProjectto update values for Staging/ProductionLabels
area:migrationlabel