fix: move precache route handler to reenable navigation handler on login redirects [LIBS-473] #809
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.
Implements LIBS-473
The routing for the "plugin precache manifest" seems to be interfering with the route to handle navigation events, which prevents the service worker from passing redirect responses to the client when the user is unauthenticated. This results in seeing the login modal when visiting a PWA app while logged out, instead of being redirected to the login page
Moving the plugin precache route handler to come after the navigation handler lets the nav. route handler send redirects to the client, letting the login page be shown correctly
Test
This can be tested by checking out this branch and building the PWA example app:
Then, upload the example PWA app to an instance and visit the app. Make sure the PWA app is installed or updated -- check the user profile menu for more information.
Log out or delete the session cookie, then visit the app URL. If it's successful, you should be redirected to the login page, instead of seeing a login modal at the PWA app URL